gem-release 0.6.0 → 0.7.0

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: 65f36f62379a2f29748762dd3c5f38ba025b16e4
4
- data.tar.gz: b963f7d5bc80a51c331d1c307de4cc1cefa27adf
3
+ metadata.gz: 700504ce4d984b97cf06d4a76ac451ffb51327d9
4
+ data.tar.gz: f900d484aaa5452a0f52d6a98b29b9968b6c8f00
5
5
  SHA512:
6
- metadata.gz: dca5c1ea0bbc479b80347a9d5cdc1070465b002311968aafc62c4afca6cddecee8096a228012edc07fca1da6fce23bdf7271533dcdbe9f26c15d308cd1e713ba
7
- data.tar.gz: 5a1b90261bdda3552dd20818debdb86eb9269640524f9c22cebf92e552c3a86bcea273a40fcb67c2233f3b2669a80bd5f58a6a0763cd6f65009f70622f2e93d0
6
+ metadata.gz: ba249b0339d5dc41df91ef3a6f1733213ab70762653dd7a743117eb7af6c049b45e0313bae5dfd0a3686a4ca6921eff66f26428fdadc3438f13c61631c176eec
7
+ data.tar.gz: b780abe7c07dbd226e8be304a7e266b3c9b79060649dbccec3a917479e516adcefb229faca384e7cd408f033b77b1dc4932c39526d572450afb3cd284058ef75
@@ -0,0 +1,13 @@
1
+ class Hash
2
+
3
+ #taken from https://gist.github.com/tommeier/1479299
4
+ def deep_symbolize_keys!
5
+ self.keys.each do |k|
6
+ new_key = k.to_sym
7
+ current_value = self.delete(k)
8
+ self[new_key] = current_value.is_a?(Hash) ? current_value.dup.deep_symbolize_keys! : current_value
9
+ end
10
+ self
11
+ end
12
+
13
+ end
@@ -5,8 +5,12 @@ module GemRelease
5
5
  super
6
6
  end
7
7
 
8
+ def default_options_with(passed_opts)
9
+ self.class::DEFAULTS.merge(Configuration.new[name.to_sym]).merge(passed_opts)
10
+ end
11
+
8
12
  def option(key, short, description)
9
- default = self.class::DEFAULTS[key]
13
+ default = Configuration.new[name.to_sym][key] || self.class::DEFAULTS[key]
10
14
 
11
15
  if default.is_a?(String)
12
16
  long = "--#{key} #{key.to_s.upcase}"
@@ -0,0 +1,33 @@
1
+ require 'yaml'
2
+ require 'core_ext/hash/symbolize_keys'
3
+
4
+ class Configuration
5
+
6
+ attr_reader :options
7
+
8
+ def initialize
9
+ load_options!
10
+ end
11
+
12
+ def load_options!
13
+ @options = Hash.new { |hash, key| hash[key] = {} }
14
+ if File.exist?(conf_path.to_s) && !File.directory?(conf_path.to_s)
15
+ config_hash = YAML.load(File.read(conf_path))
16
+ if config_hash
17
+ @options.merge!(config_hash.deep_symbolize_keys!)
18
+ end
19
+ end
20
+ end
21
+
22
+ def conf_path
23
+ File.expand_path(Dir.glob('**/.gemrelease').first.to_s)
24
+ end
25
+
26
+ def []=(key,val)
27
+ options[key] = val
28
+ end
29
+
30
+ def [](key)
31
+ options[key]
32
+ end
33
+ end
@@ -35,7 +35,7 @@ module GemRelease
35
35
  end
36
36
 
37
37
  def gem_version
38
- gemspec.version.to_s
38
+ options[:version_number] || gemspec.version.to_s
39
39
  end
40
40
 
41
41
  def gemspec
@@ -1,3 +1,3 @@
1
1
  module GemRelease
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
data/lib/gem_release.rb CHANGED
@@ -6,4 +6,5 @@ module GemRelease
6
6
  autoload :Version, 'gem_release/version'
7
7
  autoload :VersionFile, 'gem_release/version_file'
8
8
  autoload :VersionTemplate, 'gem_release/version_template'
9
- end
9
+ autoload :Configuration, 'gem_release/configuration'
10
+ end
@@ -13,10 +13,11 @@ class Gem::Commands::BootstrapCommand < Gem::Command
13
13
  :quiet => false
14
14
  }
15
15
 
16
- attr_reader :arguments, :usage
16
+ attr_reader :arguments, :usage, :name
17
17
 
18
18
  def initialize(options = {})
19
- super 'bootstrap', 'Bootstrap a new gem source repository', DEFAULTS.merge(options)
19
+ @name = 'bootstrap'
20
+ super @name, 'Bootstrap a new gem source repository', default_options_with(options)
20
21
 
21
22
  option :gemspec, '-g', 'Generate a .gemspec'
22
23
  option :scaffold, '-s', 'Scaffold lib/[gem_name]/version.rb README test/'
@@ -6,7 +6,7 @@ class Gem::Commands::BumpCommand < Gem::Command
6
6
  include GemRelease, Gem::Commands
7
7
  include Helpers, CommandOptions
8
8
 
9
- attr_reader :arguments, :usage
9
+ attr_reader :arguments, :usage, :name
10
10
 
11
11
  DEFAULTS = {
12
12
  :version => '',
@@ -20,7 +20,8 @@ class Gem::Commands::BumpCommand < Gem::Command
20
20
  }
21
21
 
22
22
  def initialize(options = {})
23
- super 'bump', 'Bump the gem version', DEFAULTS.merge(options)
23
+ @name = 'bump'
24
+ super @name, 'Bump the gem version', default_options_with(options)
24
25
 
25
26
  option :version, '-v', 'Target version: next [major|minor|patch|pre|release] or a given version number [x.x.x]'
26
27
  option :commit, '-c', 'Perform a commit after incrementing gem version'
@@ -88,6 +89,7 @@ class Gem::Commands::BumpCommand < Gem::Command
88
89
  end
89
90
  cmd.options[:quiet] = options[:quiet]
90
91
  cmd.options[:quiet_success] = true
92
+ cmd.options[:version_number] = @new_version_number
91
93
  cmd.execute
92
94
  true
93
95
  end
@@ -97,6 +99,7 @@ class Gem::Commands::BumpCommand < Gem::Command
97
99
  cmd.options[:quiet] = options[:quiet]
98
100
  cmd.options[:quiet_success] = true
99
101
  cmd.options[:push_tags_only] = true
102
+ cmd.options[:version_number] = @new_version_number
100
103
  cmd.execute
101
104
  true
102
105
  end
@@ -7,10 +7,11 @@ class Gem::Commands::GemspecCommand < Gem::Command
7
7
  :quiet => false
8
8
  }
9
9
 
10
- attr_reader :arguments, :usage
10
+ attr_reader :arguments, :usage, :name
11
11
 
12
12
  def initialize(options = {})
13
- super 'bootstrap', 'Bootstrap a new gem source repository', DEFAULTS.merge(options)
13
+ @name = 'bootstrap'
14
+ super @name, 'Bootstrap a new gem source repository', default_options_with(options)
14
15
 
15
16
  option :strategy, '-f', 'Strategy for collecting files [glob|git] in .gemspec'
16
17
  option :quiet, '-q', 'Do not output status messages'
@@ -13,10 +13,11 @@ class Gem::Commands::ReleaseCommand < Gem::Command
13
13
  :host => ''
14
14
  }
15
15
 
16
- attr_reader :arguments, :usage
16
+ attr_reader :arguments, :usage, :name
17
17
 
18
18
  def initialize(options = {})
19
- super 'release', 'Build gem from a gemspec and push to rubygems.org', DEFAULTS.merge(options)
19
+ @name = 'release'
20
+ super @name, 'Build gem from a gemspec and push to rubygems.org', default_options_with(options)
20
21
 
21
22
  option :tag, '-t', 'Create a git tag and push --tags to origin'
22
23
  option :quiet, '-q', 'Do not output status messages'
@@ -6,10 +6,11 @@ class Gem::Commands::TagCommand < Gem::Command
6
6
  :quiet => false
7
7
  }
8
8
 
9
- attr_reader :arguments, :usage
9
+ attr_reader :arguments, :usage, :name
10
10
 
11
11
  def initialize(options = {})
12
- super 'tag', 'Create a git tag and push --tags to origin', DEFAULTS.merge(options)
12
+ @name = 'tag'
13
+ super @name, 'Create a git tag and push --tags to origin', default_options_with(options)
13
14
 
14
15
  option :quiet, '-q', 'Do not output status messages'
15
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-21 00:00:00.000000000 Z
11
+ date: 2013-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_declarative
@@ -30,14 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.9.8
33
+ version: '0.14'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.9.8
40
+ version: '0.14'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
41
69
  description: Release your ruby gems with ease. (What a bold statement for such a tiny
42
70
  plugin ...)
43
71
  email: svenfuchs@artweb-design.de
@@ -45,10 +73,12 @@ executables: []
45
73
  extensions: []
46
74
  extra_rdoc_files: []
47
75
  files:
76
+ - lib/core_ext/hash/symbolize_keys.rb
48
77
  - lib/core_ext/kernel/silence.rb
49
78
  - lib/core_ext/string/camelize.rb
50
79
  - lib/gem_release.rb
51
80
  - lib/gem_release/command_options.rb
81
+ - lib/gem_release/configuration.rb
52
82
  - lib/gem_release/gemspec_template.rb
53
83
  - lib/gem_release/helpers.rb
54
84
  - lib/gem_release/template.rb
@@ -88,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
118
  version: 1.3.6
89
119
  requirements: []
90
120
  rubyforge_project: '[none]'
91
- rubygems_version: 2.0.3
121
+ rubygems_version: 2.1.11
92
122
  signing_key:
93
123
  specification_version: 4
94
124
  summary: Release your ruby gems with ease