gem-release 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,8 +7,7 @@ module GemRelease
7
7
 
8
8
  @authors ||= [`git config --get user.name`.strip]
9
9
  @email ||= `git config --get user.email`.strip
10
- @github_user ||= `git config --get github.user`.strip
11
- @homepage ||= "http://github.com/#{@github_user}/#{name}" || "[your github name]"
10
+ @homepage ||= "http://github.com/#{github_user}/#{name}" || "[your github name]"
12
11
 
13
12
  @summary ||= '[summary]'
14
13
  @description ||= '[description]'
@@ -5,25 +5,29 @@ module GemRelease
5
5
  def github_user
6
6
  @github_user ||= `git config --get github.user`.strip
7
7
  end
8
-
8
+
9
9
  def github_token
10
10
  @github_token ||= `git config --get github.token`.strip
11
11
  end
12
-
12
+
13
13
  def gem_name
14
- @gem_name ||= gemspec ? gemspec.name : File.basename(Dir.pwd)
14
+ @gem_name ||= gemspec ? gemspec.name : gem_name_from_directory
15
+ end
16
+
17
+ def gem_name_from_directory
18
+ File.basename(Dir.pwd)
15
19
  end
16
-
20
+
17
21
  def gem_filename
18
22
  gemspec.file_name
19
23
  end
20
-
24
+
21
25
  def gem_version
22
26
  gemspec.version.to_s
23
27
  end
24
-
28
+
25
29
  def gemspec
26
- @gemspec ||= silence { Gem::Specification.load(gemspec_filename) }
30
+ @gemspec ||= Gem::Specification.load(gemspec_filename) # silence { }
27
31
  rescue LoadError, RuntimeError
28
32
  nil
29
33
  end
@@ -4,12 +4,15 @@ require 'core_ext/string/camelize'
4
4
 
5
5
  module GemRelease
6
6
  class Template
7
- attr_reader :name, :module_name, :module_path
7
+ include GemRelease::Helpers
8
+
9
+ attr_reader :name, :module_name, :module_path, :options
8
10
 
9
11
  def initialize(options = {})
12
+ @options = options
10
13
  options.each { |key, value| instance_variable_set(:"@#{key}", value) }
11
14
 
12
- @name ||= File.basename(Dir.pwd)
15
+ @name ||= gem_name_from_directory
13
16
  @module_path ||= name.gsub('-', '_')
14
17
  @module_name ||= module_path.camelize
15
18
  end
@@ -1,5 +1,5 @@
1
1
  module GemRelease
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
 
4
4
  class Version < Template
5
5
  attr_reader :version
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 9
9
- version: 0.0.9
8
+ - 10
9
+ version: 0.0.10
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sven Fuchs