everyleaf-embulk_helper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47199c2195e7f7c5eaa82fcb8bc724b9d8cb6b81
4
- data.tar.gz: 36e4cef37bfec31361c210c996cae6631d4e38b7
3
+ metadata.gz: 36c1b41d191cb714c8d3b420d287402632ebb34c
4
+ data.tar.gz: 122aa4c29658a038ae0b9d71288c41cf660ce42a
5
5
  SHA512:
6
- metadata.gz: bcccc09f44218259902ef6f47cc435f22e62060e8c988b997715bc4b889eb27e28ec050de016062686e8283d96c549aa5c1e268e52db5c109dc78d81dc420da6
7
- data.tar.gz: 6ea9fb9a61bc3365e851021506a450610c63a350fe7f593e7ab78a8ff85ae7ddcab865bebc9b1350c16e1ff764c73253f8276ccb0d6e3e06b619c7e554ed8d69
6
+ metadata.gz: 90060c26bf3d014428599c451bd29c1810653d85d589979335e818d6c95316267e9a278c18a5db907a5b8e4123e33b43bef82d5173adaf7c8522317ffbb6ebf2
7
+ data.tar.gz: 7362b8bc99f5046a4d8e77cf8c840d07c200c402ea236e008658bbfec3abf492c79903021ce36cdae703263404cfc784edb282017b61162338a76c2a3f07f063
@@ -1,3 +1,8 @@
1
+ ## 0.0.2 - 2015-08-11
2
+
3
+ * [fix] Fix gemspec path within generated gemfile template [#2](https://github.com/everyleaf/everyleaf-embulk_helper/pull/2)
4
+ * [improve] generage:changelog can accept `CURRENT_VER` and `NEXT_VER` environment variable instead of auto detection
5
+
1
6
  ## 0.0.1 - 2015-08-11
2
7
 
3
8
  The first release!!
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- everyleaf-embulk_helper (0.0.1)
4
+ everyleaf-embulk_helper (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -50,10 +50,11 @@ module Everyleaf
50
50
  end
51
51
 
52
52
  def current_version
53
- Gem::Version.new(gemspec_path.read[/spec\.version += *"([0-9]+\.[0-9]+\.[0-9]+)"/, 1])
53
+ ENV["CURRENT_VER"] || Gem::Version.new(gemspec_path.read[/spec\.version += *"([0-9]+\.[0-9]+\.[0-9]+)"/, 1])
54
54
  end
55
55
 
56
56
  def next_version
57
+ return ENV["NEXT_VER"] if ENV["NEXT_VER"]
57
58
  major, minor, patch = current_version.segments
58
59
  ver = case version_target
59
60
  when "patch"
@@ -81,7 +82,7 @@ module Everyleaf
81
82
 
82
83
  def pull_request_numbers
83
84
  sync_git_repo
84
- `git log v#{old_version}..origin/master --oneline`.scan(/#[0-9]+/).map do |num_with_hash|
85
+ `git log v#{current_version}..origin/master --oneline`.scan(/#[0-9]+/).map do |num_with_hash|
85
86
  num_with_hash[/[0-9]+/]
86
87
  end
87
88
  end
@@ -40,7 +40,7 @@ module Everyleaf
40
40
  def initial_template
41
41
  <<-ERB
42
42
  source 'https://rubygems.org/'
43
- gemspec :path => '#{File.dirname(gemspec_path)}'
43
+ gemspec :path => '#{gemspec_path.dirname.relative_path_from(gemfiles_dir)}/'
44
44
 
45
45
  gem "embulk", "<%= version %>"
46
46
  ERB
@@ -1,5 +1,5 @@
1
1
  module Everyleaf
2
2
  module EmbulkHelper
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -66,6 +66,49 @@ gem "embulk", "0.1.2"
66
66
  end
67
67
  end
68
68
 
69
+ class TestInitialContent < self
70
+ def setup
71
+ FileUtils.mkdir_p root
72
+ FileUtils.touch gemspec_path
73
+
74
+ task = Gemfiles.new(options.merge({
75
+ github_name: "dummy/dummy",
76
+ gemspec: gemspec_path,
77
+ gemfile_template_path: gemfile_template_path,
78
+ }))
79
+ mute_logger(task)
80
+ task.send(:init)
81
+ end
82
+
83
+ def teardown
84
+ FileUtils.rm_rf root
85
+ end
86
+
87
+ def test_relative_path
88
+ content = File.read(gemfile_template_path)
89
+ assert content.include?("path => '../'") # the gemspec path from each gemfiles/* as relative
90
+ end
91
+
92
+ def test_embulk_version_contain
93
+ content = File.read(gemfile_template_path)
94
+ assert content.include?(%Q|gem "embulk", "<%= version %>"|)
95
+ end
96
+
97
+ private
98
+
99
+ def gemfile_template_path
100
+ root.join("gemfiles/template.erb")
101
+ end
102
+
103
+ def root
104
+ Pathname.new("/tmp/foo")
105
+ end
106
+
107
+ def gemspec_path
108
+ root.join("bar.spec")
109
+ end
110
+ end
111
+
69
112
  def test_task_installed
70
113
  Everyleaf::EmbulkHelper::Tasks.install(options)
71
114
  gemfiles_task = Rake::Task.tasks.find do |task|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everyleaf-embulk_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshihara