diff options
author | SHIBATA Hiroshi <hsbt@ruby-lang.org> | 2016-07-12 17:24:41 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-12 17:24:41 +0900 |
commit | 53bade39dd6df85768bfdc79d5febf23e8651bbe (patch) | |
tree | dcec5a86f3850c4463f7fa23cbc73150fe47d393 | |
parent | b1ad4371ef81de68821af202ca10083cc3375ef4 (diff) | |
parent | f2f3307f21c7ae21e560413d3861da9a920dd13a (diff) | |
download | psych-53bade39dd6df85768bfdc79d5febf23e8651bbe.tar.gz |
Merge pull request #285 from tenderlove/bundlerize
Bundlerize
-rw-r--r-- | .autotest | 18 | ||||
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | .travis.yml | 11 | ||||
-rw-r--r-- | Gemfile | 3 | ||||
-rw-r--r-- | Manifest.txt | 114 | ||||
-rw-r--r-- | Rakefile | 146 | ||||
-rwxr-xr-x | bin/console | 7 | ||||
-rwxr-xr-x | bin/setup | 6 | ||||
-rw-r--r-- | psych.gemspec | 35 |
9 files changed, 88 insertions, 263 deletions
diff --git a/.autotest b/.autotest deleted file mode 100644 index ac7a24c..0000000 --- a/.autotest +++ /dev/null @@ -1,18 +0,0 @@ -require "autotest/restart" -require 'rbconfig' - -Autotest.add_hook :initialize do |at| - at.find_directories = ARGV unless ARGV.empty? - at.testlib = "minitest/autorun" -end - -Autotest.add_hook :run_command do |at| - at.unit_diff = 'cat' - system "ruby -S rake compile" -end - -Autotest.add_hook :ran_command do |at| - File.open('/tmp/autotest.txt', 'wb') { |f| - f.write(at.results.join) - } -end @@ -3,5 +3,12 @@ *.jar *.class .mvn -/pkg -/tmp +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ diff --git a/.travis.yml b/.travis.yml index 102f109..4758c96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,13 +4,4 @@ rvm: - 2.2 - 2.3.0 - ruby-head - - rbx-2 -before_script: - - gem install hoe - - gem install rake-compiler - - gem install minitest -v '~> 5.0' -script: rake test -matrix: - allow_failures: - - rvm: ruby-head - - rvm: rbx-2 +before_install: gem install bundler --no-document @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gemspec diff --git a/Manifest.txt b/Manifest.txt deleted file mode 100644 index 5803f6d..0000000 --- a/Manifest.txt +++ /dev/null @@ -1,114 +0,0 @@ -.autotest -.travis.yml -CHANGELOG.rdoc -Manifest.txt -README.rdoc -Rakefile -ext/psych/depend -ext/psych/extconf.rb -ext/psych/psych.c -ext/psych/psych.h -ext/psych/psych_emitter.c -ext/psych/psych_emitter.h -ext/psych/psych_parser.c -ext/psych/psych_parser.h -ext/psych/psych_to_ruby.c -ext/psych/psych_to_ruby.h -ext/psych/psych_yaml_tree.c -ext/psych/psych_yaml_tree.h -ext/psych/yaml/LICENSE -ext/psych/yaml/api.c -ext/psych/yaml/config.h -ext/psych/yaml/dumper.c -ext/psych/yaml/emitter.c -ext/psych/yaml/loader.c -ext/psych/yaml/parser.c -ext/psych/yaml/reader.c -ext/psych/yaml/scanner.c -ext/psych/yaml/writer.c -ext/psych/yaml/yaml.h -ext/psych/yaml/yaml_private.h -lib/psych.rb -lib/psych/class_loader.rb -lib/psych/coder.rb -lib/psych/core_ext.rb -lib/psych/deprecated.rb -lib/psych/exception.rb -lib/psych/handler.rb -lib/psych/handlers/document_stream.rb -lib/psych/handlers/recorder.rb -lib/psych/json/ruby_events.rb -lib/psych/json/stream.rb -lib/psych/json/tree_builder.rb -lib/psych/json/yaml_events.rb -lib/psych/nodes.rb -lib/psych/nodes/alias.rb -lib/psych/nodes/document.rb -lib/psych/nodes/mapping.rb -lib/psych/nodes/node.rb -lib/psych/nodes/scalar.rb -lib/psych/nodes/sequence.rb -lib/psych/nodes/stream.rb -lib/psych/omap.rb -lib/psych/parser.rb -lib/psych/scalar_scanner.rb -lib/psych/set.rb -lib/psych/stream.rb -lib/psych/streaming.rb -lib/psych/syntax_error.rb -lib/psych/tree_builder.rb -lib/psych/versions.rb -lib/psych/visitors.rb -lib/psych/visitors/depth_first.rb -lib/psych/visitors/emitter.rb -lib/psych/visitors/json_tree.rb -lib/psych/visitors/to_ruby.rb -lib/psych/visitors/visitor.rb -lib/psych/visitors/yaml_tree.rb -lib/psych/y.rb -lib/psych_jars.rb -test/psych/handlers/test_recorder.rb -test/psych/helper.rb -test/psych/json/test_stream.rb -test/psych/nodes/test_enumerable.rb -test/psych/test_alias_and_anchor.rb -test/psych/test_array.rb -test/psych/test_boolean.rb -test/psych/test_class.rb -test/psych/test_coder.rb -test/psych/test_date_time.rb -test/psych/test_deprecated.rb -test/psych/test_document.rb -test/psych/test_emitter.rb -test/psych/test_encoding.rb -test/psych/test_exception.rb -test/psych/test_hash.rb -test/psych/test_json_tree.rb -test/psych/test_merge_keys.rb -test/psych/test_nil.rb -test/psych/test_null.rb -test/psych/test_numeric.rb -test/psych/test_object.rb -test/psych/test_object_references.rb -test/psych/test_omap.rb -test/psych/test_parser.rb -test/psych/test_psych.rb -test/psych/test_safe_load.rb -test/psych/test_scalar.rb -test/psych/test_scalar_scanner.rb -test/psych/test_serialize_subclasses.rb -test/psych/test_set.rb -test/psych/test_stream.rb -test/psych/test_string.rb -test/psych/test_struct.rb -test/psych/test_symbol.rb -test/psych/test_tainted.rb -test/psych/test_to_yaml_properties.rb -test/psych/test_tree_builder.rb -test/psych/test_yaml.rb -test/psych/test_yamldbm.rb -test/psych/test_yamlstore.rb -test/psych/visitors/test_depth_first.rb -test/psych/visitors/test_emitter.rb -test/psych/visitors/test_to_ruby.rb -test/psych/visitors/test_yaml_tree.rb @@ -1,123 +1,31 @@ -# -*- ruby -*- - -require 'psych' -require 'rubygems' -require 'hoe' - -def java? - RUBY_PLATFORM =~ /java/ -end - -class Hoe - remove_const :RUBY_FLAGS - flags = "-I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}" - flags = "--1.9 " + flags if java? - RUBY_FLAGS = flags -end - -gem 'rake-compiler', '>= 0.4.1' -gem 'minitest', '~> 5.0' -require "rake/extensiontask" - -Hoe.plugin :doofus, :git, :gemspec - -$hoe = Hoe.spec 'psych' do - license 'MIT' - developer 'Aaron Patterson', 'aaron@tenderlovemaking.com' - - self.extra_rdoc_files = Dir['*.rdoc'] - self.history_file = 'CHANGELOG.rdoc' - self.readme_file = 'README.rdoc' - self.testlib = :minitest - - extra_dev_deps << ['rake-compiler', '>= 0.4.1'] - extra_dev_deps << ['minitest', '~> 5.0'] - - self.spec_extras = { - :required_ruby_version => '>= 1.9.2' - } - - if java? - require './lib/psych/versions.rb' - extra_deps << ['jar-dependencies', '>= 0.1.7'] - - # the jar declaration for jar-dependencies - self.spec_extras[ 'requirements' ] = "jar org.yaml:snakeyaml, #{Psych::DEFAULT_SNAKEYAML_VERSION}" - self.spec_extras[ 'platform' ] = 'java' - # TODO: clean this section up. - require "rake/javaextensiontask" - Rake::JavaExtensionTask.new("psych", spec) do |ext| - require 'maven/ruby/maven' - # uses Mavenfile to write classpath into pkg/classpath - # and tell maven via system properties the snakeyaml version - # this is basically the same as running from the commandline: - # rmvn dependency:build-classpath -Dsnakeyaml.version='use version from Psych::DEFAULT_SNAKEYAML_VERSION here' - Maven::Ruby::Maven.new.exec( 'dependency:build-classpath', "-Dsnakeyaml.version=#{Psych::DEFAULT_SNAKEYAML_VERSION}", '-Dverbose=true')#, '--quiet' ) - ext.source_version = '1.7' - ext.target_version = '1.7' - ext.classpath = File.read('pkg/classpath') - ext.ext_dir = 'ext/java' - end - else - self.spec_extras[:extensions] = ["ext/psych/extconf.rb"] - Rake::ExtensionTask.new "psych", spec do |ext| - ext.lib_dir = File.join(*['lib', ENV['FAT_DIR']].compact) - end - end -end - -def gem_build_path - File.join 'pkg', $hoe.spec.full_name -end - -def add_file_to_gem relative_path - target_path = File.join gem_build_path, relative_path - target_dir = File.dirname(target_path) - mkdir_p target_dir unless File.directory?(target_dir) - rm_f target_path - safe_ln relative_path, target_path - $hoe.spec.files.concat [relative_path] -end - -if java? - task gem_build_path => [:compile] do - add_file_to_gem 'lib/psych.jar' +require "bundler/gem_tasks" +require "rake/testtask" + +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList['test/**/test_*.rb'] +end + +if RUBY_PLATFORM =~ /java/ + require 'rake/javaextensiontask' + Rake::JavaExtensionTask.new("psych") do |ext| + require 'maven/ruby/maven' + # uses Mavenfile to write classpath into pkg/classpath + # and tell maven via system properties the snakeyaml version + # this is basically the same as running from the commandline: + # rmvn dependency:build-classpath -Dsnakeyaml.version='use version from Psych::DEFAULT_SNAKEYAML_VERSION here' + Maven::Ruby::Maven.new.exec( 'dependency:build-classpath', "-Dsnakeyaml.version=#{Psych::DEFAULT_SNAKEYAML_VERSION}", '-Dverbose=true')#, '--quiet' ) + ext.source_version = '1.7' + ext.target_version = '1.7' + ext.classpath = File.read('pkg/classpath') + ext.ext_dir = 'ext/java' end -end - -Hoe.add_include_dirs('.:lib/psych') - -task :test => :compile - -task :hack_spec do - $hoe.spec.extra_rdoc_files.clear -end -task 'core:spec' => [:hack_spec, 'gem:spec'] - -desc "merge psych in to ruby trunk" -namespace :merge do - basedir = File.expand_path File.dirname __FILE__ - rubydir = File.join ENV['HOME'], 'git', 'ruby' - mergedirs = { - # From # To - [basedir, 'ext', 'psych/'] => [rubydir, 'ext', 'psych/'], - [basedir, 'lib/'] => [rubydir, 'ext', 'psych', 'lib/'], - [basedir, 'test', 'psych/'] => [rubydir, 'test', 'psych/'], - } - - rsync = 'rsync -av --exclude lib --exclude ".*" --exclude "*.o" --exclude Makefile --exclude mkmf.log --delete' - - task :to_ruby do - mergedirs.each do |from, to| - sh "#{rsync} #{File.join(*from)} #{File.join(*to)}" - end - end - - task :from_ruby do - mergedirs.each do |from, to| - sh "#{rsync} #{File.join(*to)} #{File.join(*from)}" - end +else + require 'rake/extensiontask' + Rake::ExtensionTask.new("psych") do |ext| + ext.lib_dir = File.join(*['lib', ENV['FAT_DIR']].compact) end end -# vim: syntax=ruby +task :default => [:compile, :test] diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..86c5a21 --- /dev/null +++ b/bin/console @@ -0,0 +1,7 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "psych" + +require "irb" +IRB.start diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..cf4ad25 --- /dev/null +++ b/bin/setup @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install diff --git a/psych.gemspec b/psych.gemspec new file mode 100644 index 0000000..3ce35d4 --- /dev/null +++ b/psych.gemspec @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = "psych" + s.version = "2.1.0" + s.authors = ["Aaron Patterson", "SHIBATA Hiroshi"] + s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"] + s.date = "2016-06-24" + s.summary = "Psych is a YAML parser and emitter" + s.description = "Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]\nfor its YAML parsing and emitting capabilities. In addition to wrapping\nlibyaml, Psych also knows how to serialize and de-serialize most Ruby objects\nto and from the YAML format." + s.homepage = "http://github.com/tenderlove/psych" + s.licenses = ["MIT"] + s.require_paths = ["lib"] + s.files = [".travis.yml", "CHANGELOG.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h", "ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h", "ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h", "ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c", "ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c", "ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h", "lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.rb", "lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb", "lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb", "lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb", "lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb", "lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb", "lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb", "lib/psych/tree_builder.rb", "lib/psych/versions.rb", "lib/psych/visitors.rb", "lib/psych/visitors/depth_first.rb", "lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb", "lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "lib/psych_jars.rb", "test/psych/handlers/test_recorder.rb", "test/psych/helper.rb", "test/psych/json/test_stream.rb", "test/psych/nodes/test_enumerable.rb", "test/psych/test_alias_and_anchor.rb", "test/psych/test_array.rb", "test/psych/test_boolean.rb", "test/psych/test_class.rb", "test/psych/test_coder.rb", "test/psych/test_date_time.rb", "test/psych/test_deprecated.rb", "test/psych/test_document.rb", "test/psych/test_emitter.rb", "test/psych/test_encoding.rb", "test/psych/test_exception.rb", "test/psych/test_hash.rb", "test/psych/test_json_tree.rb", "test/psych/test_merge_keys.rb", "test/psych/test_nil.rb", "test/psych/test_null.rb", "test/psych/test_numeric.rb", "test/psych/test_object.rb", "test/psych/test_object_references.rb", "test/psych/test_omap.rb", "test/psych/test_parser.rb", "test/psych/test_psych.rb", "test/psych/test_safe_load.rb", "test/psych/test_scalar.rb", "test/psych/test_scalar_scanner.rb", "test/psych/test_serialize_subclasses.rb", "test/psych/test_set.rb", "test/psych/test_stream.rb", "test/psych/test_string.rb", "test/psych/test_struct.rb", "test/psych/test_symbol.rb", "test/psych/test_tainted.rb", "test/psych/test_to_yaml_properties.rb", "test/psych/test_tree_builder.rb", "test/psych/test_yaml.rb", "test/psych/test_yamldbm.rb", "test/psych/test_yamlstore.rb", "test/psych/visitors/test_depth_first.rb", "test/psych/visitors/test_emitter.rb", "test/psych/visitors/test_to_ruby.rb", "test/psych/visitors/test_yaml_tree.rb"] + + s.rdoc_options = ["--main", "README.rdoc"] + s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc", "CHANGELOG.rdoc", "README.rdoc"] + + s.required_ruby_version = Gem::Requirement.new(">= 1.9.2") + s.rubygems_version = "2.5.1" + s.required_rubygems_version = Gem::Requirement.new(">= 0") + + s.add_development_dependency(%q<rake-compiler>, [">= 0.4.1"]) + s.add_development_dependency(%q<minitest>, ["~> 5.0"]) + + if RUBY_PLATFORM =~ /java/ + require 'psych/versions' + s.platform = 'java' + s.requirements = "jar org.yaml:snakeyaml, #{Psych::DEFAULT_SNAKEYAML_VERSION}" + s.add_dependency 'jar-dependencies', '>= 0.1.7' + s.add_development_dependency 'ruby-maven' + else + s.extensions = ["ext/psych/extconf.rb"] + end +end |