midwire_common 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *0.1.6* (December 31, 2013)
2
+
3
+ * Handle nested modules
4
+
1
5
  *0.1.5* (September 19, 2013)
2
6
 
3
7
  * Added #pop method to Hash
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Midwire Common Gem
2
2
 
3
- **Version: 0.1.5**
3
+ **Version: 0.1.6**
4
4
 
5
5
  A handy Ruby library for Midwire development
6
6
 
@@ -1,6 +1,6 @@
1
1
  original_verbosity = $VERBOSE
2
2
  $VERBOSE = nil
3
3
  module MidwireCommon
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
6
6
  $VERBOSE = original_verbosity
@@ -65,16 +65,21 @@ namespace :version do
65
65
  private
66
66
 
67
67
  def version_file_path
68
- "#{PROJECT_ROOT}/lib/#{PROJECT_NAME}/version.rb"
68
+ split = PROJECT_NAME.split('-')
69
+ "#{PROJECT_ROOT}/lib/#{split.join('/')}/version.rb"
69
70
  end
70
71
 
71
- def read_version
72
- # Get module name
73
- lines = File.readlines(version_file_path)
74
- module_name = nil
75
- if module_line = lines.grep(/^module/)
76
- module_name = module_line.flatten[0].scan(/[^\s]+\s+([A-Za-z]+)$/).flatten[0]
72
+ def module_name
73
+ if PROJECT_NAME.match(/-/)
74
+ PROJECT_NAME.split('-').map {|e| e.capitalize}.join('::')
75
+ elsif PROJECT_NAME.match(/_/)
76
+ PROJECT_NAME.split('_').map {|e| e.capitalize}.join
77
+ else
78
+ PROJECT_NAME.capitalize
77
79
  end
80
+ end
81
+
82
+ def read_version
78
83
  load version_file_path
79
84
  text = eval("#{module_name}::VERSION")
80
85
  major, minor, patch = text.split('.')
@@ -5,8 +5,8 @@ Gem::Specification.new do |gem|
5
5
  gem.authors = ["Chris Blackburn"]
6
6
  gem.email = ["chris@midwiretech.com"]
7
7
  gem.description = %q{A useful Ruby library for the Midwire development team}
8
- gem.summary = %q{Midiwre Ruby Library}
9
- gem.homepage = "http://git-2.americadirect.net/prosup"
8
+ gem.summary = %q{Midwire Ruby Library}
9
+ gem.homepage = "https://github.com/midwire/midwire_common"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  # encoding: ascii-8bit
2
4
  require 'spec_helper'
3
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midwire_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-19 00:00:00.000000000 Z
12
+ date: 2013-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -183,7 +183,7 @@ files:
183
183
  - spec/lib/midwire_common/time_spec.rb
184
184
  - spec/lib/midwire_common/time_tool_spec.rb
185
185
  - spec/spec_helper.rb
186
- homepage: http://git-2.americadirect.net/prosup
186
+ homepage: https://github.com/midwire/midwire_common
187
187
  licenses: []
188
188
  post_install_message:
189
189
  rdoc_options: []
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  segments:
199
199
  - 0
200
- hash: 3286182842310283713
200
+ hash: -4180799989477412744
201
201
  required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  none: false
203
203
  requirements:
@@ -206,13 +206,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  segments:
208
208
  - 0
209
- hash: 3286182842310283713
209
+ hash: -4180799989477412744
210
210
  requirements: []
211
211
  rubyforge_project:
212
212
  rubygems_version: 1.8.23
213
213
  signing_key:
214
214
  specification_version: 3
215
- summary: Midiwre Ruby Library
215
+ summary: Midwire Ruby Library
216
216
  test_files:
217
217
  - spec/lib/midwire_common/array_spec.rb
218
218
  - spec/lib/midwire_common/data_file_cache_spec.rb