fun_with_version_strings 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDk1MmRkZjVlMjJmMzA5MDY3MTQxOThkMzQyYTdhMzg3MzNjMTZjZA==
5
- data.tar.gz: !binary |-
6
- MzU4M2E5YWY2YWMyYzZhZDZlNzg4MjdkYjUzMWMwYjI3NzE2MzlkMw==
2
+ SHA256:
3
+ metadata.gz: 9745e4351e58762e6f341572eee4ac60bf66db3f4eb7e613886f67aab510dc83
4
+ data.tar.gz: ee9492bb50d66df5599086fffc7961799ad765f62a49f3ff78e5d338d3519fab
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NzhiOWQyYjA5YmE3Mzk3YzFlY2YzMDMyZGMzNjI4NWYzZjFiMjgyODE1ZDkw
10
- NjMzZDIwZjM4MDQ5NWU3ZTU0ZGI4NDFhOGNmNGJjOGNkZWRhNjgxZTFhYzZi
11
- YjRhYTM5ZDNkNTgxNGUxOTE2ZjY5NDY1NzcyOTYwMDQxZGI5ZDE=
12
- data.tar.gz: !binary |-
13
- YmViMjA3NzgwMmI5YTVhMmYzYjVlODIxYjkzYTcyZjNhYmVlYmIzNmUwMGQy
14
- MWMxOTViYTk3Y2I4NDE5MmNmZjVjODA4MTJkMjYwZTVjNzlhMjZiYTA0ZGI3
15
- N2IzOGYyOWVmMjQ5NGUzNWM2NjliNjA4ZmYxYjQ4MmJlNWNkOWU=
6
+ metadata.gz: 3127bdd23ac92b3352f4138edbaf537189b2ff3dd31991ba2c3bccefd75dbeb9119d82db5ff2ba2c98f9957e210399ad1c0fbe71bd723db33ac6e406745fde56
7
+ data.tar.gz: 2617ac899558d0970d972f0a3e27edc58886580d722d39e10663666a29fc090fc7c5a4a040974e7cb0f3a0d686371b50b882066c038b269a9ff3cc0ffe90c97c
data/Gemfile CHANGED
@@ -6,11 +6,7 @@ source "http://rubygems.org"
6
6
  # Add dependencies to develop your gem here.
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
- gem "shoulda", "~> 3.5"
10
- gem "rdoc", "~> 3.12"
11
- gem "bundler", "~> 1.0"
12
- gem "jeweler", "~> 2.0.1"
13
- gem "simplecov", ">= 0.8"
9
+ gem "fun_with_testing", "~> 0.0", ">= 0.0.10"
14
10
  end
15
11
 
16
- gem "fun_with_files"
12
+ gem "fun_with_files", "~> 0.0", ">= 0.0.17"
data/README.rdoc CHANGED
@@ -12,6 +12,8 @@ Then the following is true:
12
12
  MyGem.version.major # => 0
13
13
  MyGem.version.minor # => 0
14
14
  MyGem.version.patch # => 3
15
+
16
+ You can also refer to it using MyGem::VERSION
15
17
 
16
18
  You can also compare versions. Observe:
17
19
 
@@ -32,7 +34,7 @@ It's a common pattern with my gems.
32
34
 
33
35
  Other useful stuff:
34
36
 
35
- "10.4.9".fwvs_version_string.patch # => 9
37
+ "10.4.9".fwvs_version_string.patch # => 9 (converts a normal string into a FunWith::VersionStrings::VersionString)
36
38
 
37
39
 
38
40
 
data/Rakefile CHANGED
@@ -9,10 +9,11 @@ rescue Bundler::BundlerError => e
9
9
  $stderr.puts "Run `bundle install` to install missing gems"
10
10
  exit e.status_code
11
11
  end
12
+
12
13
  require 'rake'
13
14
 
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
15
+ require 'juwelier'
16
+ Juwelier::Tasks.new do |gem|
16
17
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
18
  gem.name = "fun_with_version_strings"
18
19
  gem.homepage = "http://github.com/darthschmoo/fun_with_version_strings"
@@ -23,7 +24,7 @@ Jeweler::Tasks.new do |gem|
23
24
  gem.authors = ["Bryce Anderson"]
24
25
  # dependencies defined in Gemfile
25
26
  end
26
- Jeweler::RubygemsDotOrgTasks.new
27
+ Juwelier::RubygemsDotOrgTasks.new
27
28
 
28
29
  require 'rake/testtask'
29
30
  Rake::TestTask.new(:test) do |test|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -9,9 +9,13 @@ module FunWith
9
9
  if obj.respond_to?(:version)
10
10
  warn( "FunWith::VersionStrings (warn): #{obj.to_s[0..100]} already responds to version(). Leaving alone.")
11
11
  return nil
12
+ else
13
+ obj.extend( VersionizeExtender )
14
+ obj.const_set(:VERSION, version_string) unless defined?(obj::VERSION)
12
15
  end
13
16
 
14
17
  if version_string.nil?
18
+ # if VERSION constant is already set for the object, then we don't need to do anything.
15
19
  if obj.respond_to?(:root) && obj.root.is_a?(FunWith::Files::FilePath) && obj.root("VERSION").file?
16
20
  version_string = obj.root("VERSION").read
17
21
  else
@@ -19,7 +23,6 @@ module FunWith
19
23
  end
20
24
  end
21
25
 
22
- obj.extend( VersionizeExtender )
23
26
  obj.version( version_string )
24
27
  end
25
28
  end
@@ -2,7 +2,7 @@ module FunWith
2
2
  module VersionStrings
3
3
  module VersionizeExtender
4
4
  def version( str = nil )
5
- @fwvs_version_string ||= str.fwvs_version_string
5
+ @fwvs_version_string = str.fwvs_version_string unless str.nil?
6
6
  @fwvs_version_string
7
7
  end
8
8
  end
data/test/helper.rb CHANGED
@@ -1,25 +1,27 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
1
+ # require 'rubygems'
2
+ # require 'bundler'
3
+ # begin
4
+ # Bundler.setup(:default, :development)
5
+ # rescue Bundler::BundlerError => e
6
+ # $stderr.puts e.message
7
+ # $stderr.puts "Run `bundle install` to install missing gems"
8
+ # exit e.status_code
9
+ # end
10
+ # require 'test/unit'
11
+ # require 'shoulda'
12
12
 
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
13
+ # $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ # $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'fun_with_testing'
15
16
  require 'fun_with_version_strings'
16
17
 
17
- include FunWith::VersionStrings
18
18
 
19
- class Test::Unit::TestCase
20
- end
19
+ # class Test::Unit::TestCase
20
+ # end
21
+
22
+ class VersionStringsTestCase < FunWith::Testing::TestCase
23
+ include FunWith::VersionStrings
21
24
 
22
- class VersionStringsTestCase < Test::Unit::TestCase
23
25
  def assert_valid_version_string( str, opts = {} )
24
26
  str = str.fwvs_version_string
25
27
  for level in [:major, :minor, :patch]
@@ -60,20 +60,21 @@ class TestFunWithVersionStrings < VersionStringsTestCase
60
60
  mod = Module.new
61
61
 
62
62
  assert_raises( RuntimeError ) do
63
- FunWith::VersionStrings.versionize( @module )
63
+ FunWith::VersionStrings.versionize( mod )
64
64
  end
65
65
  end
66
66
 
67
67
  should "raise error when root has no VERSION file" do
68
68
  mod = Module.new
69
- FunWith::Files::RootPath.rootify(mod, FunWith::VersionStrings.root("test"))
69
+ FunWith::Files::RootPath.rootify( mod, FunWith::VersionStrings.root("test") )
70
70
  assert_raises( RuntimeError ) do
71
- FunWith::VersionStrings.versionize( @module )
71
+ FunWith::VersionStrings.versionize( mod )
72
72
  end
73
73
  end
74
74
 
75
75
  should "set version by VERSION file when module has a root" do
76
76
  mod = Module.new
77
+
77
78
  FunWith::Files::RootPath.rootify( mod, FunWith::VersionStrings.root )
78
79
  FunWith::VersionStrings.versionize( mod )
79
80
  assert FunWith::VersionStrings.respond_to?(:version)
metadata CHANGED
@@ -1,99 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fun_with_version_strings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryce Anderson
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2014-03-20 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: fun_with_files
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ! '>='
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
18
+ version: '0.0'
19
+ - - ">="
25
20
  - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: shoulda
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: '3.5'
34
- type: :development
21
+ version: 0.0.17
22
+ type: :runtime
35
23
  prerelease: false
36
24
  version_requirements: !ruby/object:Gem::Requirement
37
25
  requirements:
38
- - - ~>
39
- - !ruby/object:Gem::Version
40
- version: '3.5'
41
- - !ruby/object:Gem::Dependency
42
- name: rdoc
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
26
+ - - "~>"
46
27
  - !ruby/object:Gem::Version
47
- version: '3.12'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
28
+ version: '0.0'
29
+ - - ">="
53
30
  - !ruby/object:Gem::Version
54
- version: '3.12'
31
+ version: 0.0.17
55
32
  - !ruby/object:Gem::Dependency
56
- name: bundler
33
+ name: fun_with_testing
57
34
  requirement: !ruby/object:Gem::Requirement
58
35
  requirements:
59
- - - ~>
36
+ - - "~>"
60
37
  - !ruby/object:Gem::Version
61
- version: '1.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- version: '1.0'
69
- - !ruby/object:Gem::Dependency
70
- name: jeweler
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ~>
38
+ version: '0.0'
39
+ - - ">="
74
40
  - !ruby/object:Gem::Version
75
- version: 2.0.1
41
+ version: 0.0.10
76
42
  type: :development
77
43
  prerelease: false
78
44
  version_requirements: !ruby/object:Gem::Requirement
79
45
  requirements:
80
- - - ~>
46
+ - - "~>"
81
47
  - !ruby/object:Gem::Version
82
- version: 2.0.1
83
- - !ruby/object:Gem::Dependency
84
- name: simplecov
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ! '>='
88
- - !ruby/object:Gem::Version
89
- version: '0.8'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ! '>='
48
+ version: '0.0'
49
+ - - ">="
95
50
  - !ruby/object:Gem::Version
96
- version: '0.8'
51
+ version: 0.0.10
97
52
  description: A simple little gem for adding a version string to any Ruby object.
98
53
  email: keeputahweird@gmail.com
99
54
  executables: []
@@ -102,7 +57,7 @@ extra_rdoc_files:
102
57
  - LICENSE.txt
103
58
  - README.rdoc
104
59
  files:
105
- - .document
60
+ - ".document"
106
61
  - Gemfile
107
62
  - LICENSE.txt
108
63
  - README.rdoc
@@ -120,24 +75,21 @@ homepage: http://github.com/darthschmoo/fun_with_version_strings
120
75
  licenses:
121
76
  - MIT
122
77
  metadata: {}
123
- post_install_message:
124
78
  rdoc_options: []
125
79
  require_paths:
126
80
  - lib
127
81
  required_ruby_version: !ruby/object:Gem::Requirement
128
82
  requirements:
129
- - - ! '>='
83
+ - - ">="
130
84
  - !ruby/object:Gem::Version
131
85
  version: '0'
132
86
  required_rubygems_version: !ruby/object:Gem::Requirement
133
87
  requirements:
134
- - - ! '>='
88
+ - - ">="
135
89
  - !ruby/object:Gem::Version
136
90
  version: '0'
137
91
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.2.2
140
- signing_key:
92
+ rubygems_version: 3.7.2
141
93
  specification_version: 4
142
94
  summary: Add a version string (with :major,:minor, and :patch methods) to a Ruby object.
143
95
  test_files: []