fun_with_gems 0.0.2 → 0.0.8
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 +5 -13
- data/.document +5 -0
- data/CHANGELOG.markdown +29 -0
- data/Gemfile +6 -11
- data/README.rdoc +125 -1
- data/ROADMAP.md +6 -0
- data/Rakefile +15 -46
- data/VERSION +1 -1
- data/lib/fun_with/gems/api_extender.rb +46 -0
- data/lib/fun_with/gems/configuration_installer.rb +86 -0
- data/lib/fun_with/gems/constant_builder.rb +36 -0
- data/lib/fun_with/gems/core_extender.rb +65 -0
- data/lib/fun_with/gems/core_extensions/module.rb +9 -3
- data/lib/fun_with/gems/fun_gem_api.rb +62 -3
- data/lib/fun_with/gems/gem_api.rb +78 -47
- data/lib/fun_with/gems/inclusionizer.rb +34 -0
- data/lib/fun_with/gems/library_requirer.rb +54 -0
- data/lib/fun_with/gems/rake_class_methods.rb +111 -0
- data/lib/fun_with/gems/rakefile.rb +114 -0
- data/lib/fun_with/gems/root_setter.rb +19 -0
- data/lib/fun_with/gems/test_case_extender.rb +27 -0
- data/lib/fun_with/gems/testing/assertions.rb +22 -0
- data/lib/fun_with/gems/testing/gem_to_test_methods.rb +37 -0
- data/lib/fun_with/gems/testing/test_case_extensions.rb +39 -0
- data/lib/fun_with/gems/testing/test_results.rb +40 -0
- data/lib/fun_with/gems/testing/test_setup.rb +22 -0
- data/lib/fun_with/gems/testing/test_suite_runner.rb +28 -0
- data/lib/fun_with/gems/testing/validator.rb +52 -0
- data/lib/fun_with/gems/versionizer.rb +41 -0
- data/lib/fun_with_gems.rb +15 -14
- data/lib/tasks/fun_with/gems/publish.rake +8 -0
- data/lib/tasks/fun_with/gems/validate.rake +28 -0
- data/tasks/empty/empty.rake +6 -0
- data/tasks/empty/environment.rake +7 -0
- data/test/assertions.rb +15 -0
- data/test/data/test_gems/array_inherits_enumerable/VERSION +1 -0
- data/test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable/core_extensions/comparable.rb +9 -0
- data/test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable/core_extensions/enumerable.rb +10 -0
- data/test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable/core_extensions/numeric.rb +22 -0
- data/test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable.rb +1 -0
- data/test/data/test_gems/fun_with_llamas/lib/fun_with/llamas/gem_api.rb +10 -0
- data/test/data/test_gems/fun_with_llamas/lib/fun_with/llamas/llama.rb +40 -0
- data/test/data/test_gems/fun_with_llamas/lib/fun_with/llamas/trainer.rb +15 -0
- data/test/data/test_gems/integer_magic/VERSION +1 -0
- data/test/data/test_gems/integer_magic/config/gem_config.rb +4 -0
- data/test/data/test_gems/integer_magic/lib/integer_magic/core_extensions/integer.rb +28 -0
- data/test/data/test_gems/integer_magic/lib/integer_magic/core_extensions/numeric.rb +13 -0
- data/test/data/test_gems/integer_magic/lib/integer_magic.rb +1 -0
- data/test/helper.rb +9 -38
- data/test/test_core_extensions.rb +10 -0
- data/test/test_fun_with_gems.rb +9 -16
- data/test/test_library_requirer.rb +13 -0
- data/test/test_the_test_case.rb +24 -0
- data/test/test_the_test_gems.rb +152 -0
- metadata +123 -40
- data/lib/fun_with/gems/mechanic.rb +0 -27
- data/lib/fun_with/gems/validator.rb +0 -69
- data/test/test_gem/lib/fun_with/llamas/llama.rb +0 -9
- data/test/test_gem/lib/fun_with/llamas/trainer.rb +0 -9
- /data/test/{test_gem → data/test_gems/fun_with_llamas}/VERSION +0 -0
- /data/test/{test_gem → data/test_gems/fun_with_llamas}/lib/fun_with_llamas.rb +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
require 'helper'
|
|
2
|
+
|
|
3
|
+
class TestTheTestGems < FunWith::Gems::TestCase
|
|
4
|
+
def load_llamas
|
|
5
|
+
load_gem( :llamas )
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def load_integer_magic
|
|
9
|
+
load_gem( :integer_magic )
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def load_array_inherits_enumerable
|
|
13
|
+
load_gem( :array_inherits_enumerable )
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def load_gem( g )
|
|
17
|
+
@test_gem_dir = FunWith::Gems.root( "test", "data", "test_gems" )
|
|
18
|
+
|
|
19
|
+
case g
|
|
20
|
+
when :llamas
|
|
21
|
+
@test_gem_dir.join( "fun_with_llamas", "lib", "fun_with_llamas.rb" ).requir
|
|
22
|
+
assert defined?( FunWith::Llamas )
|
|
23
|
+
when :integer_magic
|
|
24
|
+
@test_gem_dir.join( "integer_magic", "lib", "integer_magic.rb" ).requir
|
|
25
|
+
assert defined?( IntegerMagic )
|
|
26
|
+
when :array_inherits_enumerable
|
|
27
|
+
@test_gem_dir.join( "array_inherits_enumerable", "lib", "array_inherits_enumerable.rb" ).requir
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
context "testing gem loading" do
|
|
32
|
+
setup do
|
|
33
|
+
# load Llama gem
|
|
34
|
+
load_llamas
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
should "load llama gem" do
|
|
38
|
+
assert defined?( FunWith )
|
|
39
|
+
assert defined?( FunWith::Llamas )
|
|
40
|
+
assert defined?( FunWith::Llamas::Llama )
|
|
41
|
+
assert defined?( FunWith::Llamas::Trainer )
|
|
42
|
+
assert_respond_to( FunWith::Llamas::Llama.new( "Ella" ), :spit )
|
|
43
|
+
|
|
44
|
+
assert_equal 3, FunWith::Llamas.version.major
|
|
45
|
+
assert_equal 5, FunWith::Llamas.version.minor
|
|
46
|
+
assert_equal 2, FunWith::Llamas.version.patch
|
|
47
|
+
|
|
48
|
+
assert FunWith::Llamas.valid_gem?
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
should "extend the FunWith::Llamas gem with its GemAPI" do
|
|
52
|
+
assert_respond_to( FunWith::Llamas, :can_make_the_llamas_dance? )
|
|
53
|
+
assert FunWith::Llamas.can_make_the_llamas_dance?
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
should "demonstrate festive llama/trainer interaction" do
|
|
57
|
+
trainer = FunWith::Llamas::Trainer.new( "Karsten" )
|
|
58
|
+
llama = FunWith::Llamas::Llama.new( "Babette" )
|
|
59
|
+
|
|
60
|
+
assert_false llama.knows?( trainer )
|
|
61
|
+
|
|
62
|
+
trainer.brush( llama )
|
|
63
|
+
|
|
64
|
+
assert_true llama.knows?( trainer )
|
|
65
|
+
|
|
66
|
+
assert_equal 1, llama.trainer_score( trainer )
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
context "testing core_extension functionality" do
|
|
71
|
+
setup do
|
|
72
|
+
load_integer_magic
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
should "load IntegerMagic gem" do
|
|
76
|
+
assert defined?( IntegerMagic )
|
|
77
|
+
assert_fun_gem( IntegerMagic )
|
|
78
|
+
assert_version( IntegerMagic, "3.1.4" )
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
should "successfully load core_extension modules" do
|
|
82
|
+
assert defined?( IntegerMagic::CoreExtensions::Integer )
|
|
83
|
+
assert defined?( IntegerMagic::CoreExtensions::Numeric )
|
|
84
|
+
assert defined?( IntegerMagic::CoreExtensions::Integer::Constants )
|
|
85
|
+
assert defined?( IntegerMagic::CoreExtensions::Integer::InstanceMethods )
|
|
86
|
+
assert defined?( IntegerMagic::CoreExtensions::Integer::ClassMethods )
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
should "include core_extension functionality on Integer and Numeric" do
|
|
90
|
+
assert_respond_to( 6, :odd? )
|
|
91
|
+
assert_respond_to( 5, :even? )
|
|
92
|
+
refute 6.odd?
|
|
93
|
+
refute 5.even?
|
|
94
|
+
|
|
95
|
+
assert_respond_to( 4.1, :integer? )
|
|
96
|
+
assert_respond_to( Integer, :thinking_of_a_number_between_zero_and )
|
|
97
|
+
assert_equal( :you_guessed_correctly, Integer.thinking_of_a_number_between_zero_and( 1_000_000 ) )
|
|
98
|
+
assert_zero( Integer::ZERO )
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
context "testing install of default configurations" do
|
|
103
|
+
setup do
|
|
104
|
+
load_integer_magic
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# To make this test pass, I'll need to clear out the fun_gem cruft from FunWith::Configurations,
|
|
108
|
+
# then make FunWith::Gems dependent on it rather than vice versa.
|
|
109
|
+
should "load a default configuration" do
|
|
110
|
+
assert_respond_to( IntegerMagic, :config ) if defined?( FunWith::Configurations )
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
context "load ArrayInheritsEnumerable gem" do
|
|
115
|
+
setup do
|
|
116
|
+
load_array_inherits_enumerable
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
should "extend Enumerable" do
|
|
120
|
+
assert defined?( ArrayInheritsEnumerable::CoreExtensions::Enumerable )
|
|
121
|
+
assert_includes( Enumerable.included_modules, ArrayInheritsEnumerable::CoreExtensions::Enumerable )
|
|
122
|
+
assert_includes( Enumerable.instance_methods, :array_should_have_this_method )
|
|
123
|
+
|
|
124
|
+
assert_respond_to( [], :array_should_have_this_method )
|
|
125
|
+
assert_respond_to( {}, :array_should_have_this_method )
|
|
126
|
+
assert_respond_to( Set.new, :array_should_have_this_method )
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
should "extend Comparable" do
|
|
130
|
+
assert defined?( ArrayInheritsEnumerable::CoreExtensions::Comparable )
|
|
131
|
+
assert_includes( Comparable.included_modules, ArrayInheritsEnumerable::CoreExtensions::Comparable )
|
|
132
|
+
assert_includes( Comparable.instance_methods, :string_should_have_this_method )
|
|
133
|
+
|
|
134
|
+
assert_respond_to( "", :string_should_have_this_method )
|
|
135
|
+
assert_respond_to( 3, :string_should_have_this_method ) # because Integer is also Comparable
|
|
136
|
+
assert_equal( :it_does, Time.now.string_should_have_this_method ) # and so is Time
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
should "extend Numeric" do
|
|
140
|
+
assert defined?( ArrayInheritsEnumerable::CoreExtensions::Numeric )
|
|
141
|
+
assert_respond_to( 3, :prime? )
|
|
142
|
+
assert_equal :maybe, 3.prime?
|
|
143
|
+
|
|
144
|
+
assert_respond_to( Numeric, :give_me_a_random_number )
|
|
145
|
+
assert_equal :no, Numeric.give_me_a_random_number
|
|
146
|
+
assert_equal :no, Integer.give_me_a_random_number
|
|
147
|
+
assert_equal :no, Float.give_me_a_random_number
|
|
148
|
+
|
|
149
|
+
assert_greater_than 10 ** 100, Numeric::COUNTLESS
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
metadata
CHANGED
|
@@ -1,118 +1,201 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fun_with_gems
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bryce Anderson
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
13
|
+
name: juwelier
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- -
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
18
24
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0
|
|
20
|
-
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: rake
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
21
31
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '0
|
|
32
|
+
version: '0'
|
|
23
33
|
type: :runtime
|
|
24
34
|
prerelease: false
|
|
25
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
36
|
requirements:
|
|
27
|
-
- -
|
|
37
|
+
- - ">="
|
|
28
38
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0
|
|
30
|
-
|
|
39
|
+
version: '0'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: fun_with_files
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0.0'
|
|
47
|
+
- - ">="
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: 0.0.17
|
|
50
|
+
type: :runtime
|
|
51
|
+
prerelease: false
|
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
54
|
+
- - "~>"
|
|
31
55
|
- !ruby/object:Gem::Version
|
|
32
56
|
version: '0.0'
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: 0.0.17
|
|
33
60
|
- !ruby/object:Gem::Dependency
|
|
34
61
|
name: fun_with_version_strings
|
|
35
62
|
requirement: !ruby/object:Gem::Requirement
|
|
36
63
|
requirements:
|
|
37
|
-
- -
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: 0.0.3
|
|
40
|
-
- - ~>
|
|
64
|
+
- - "~>"
|
|
41
65
|
- !ruby/object:Gem::Version
|
|
42
66
|
version: '0.0'
|
|
67
|
+
- - ">="
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: 0.0.4
|
|
43
70
|
type: :runtime
|
|
44
71
|
prerelease: false
|
|
45
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
73
|
requirements:
|
|
47
|
-
- -
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: 0.0.3
|
|
50
|
-
- - ~>
|
|
74
|
+
- - "~>"
|
|
51
75
|
- !ruby/object:Gem::Version
|
|
52
76
|
version: '0.0'
|
|
77
|
+
- - ">="
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: 0.0.4
|
|
80
|
+
- !ruby/object:Gem::Dependency
|
|
81
|
+
name: sorted_set
|
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '0'
|
|
87
|
+
type: :runtime
|
|
88
|
+
prerelease: false
|
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
90
|
+
requirements:
|
|
91
|
+
- - ">="
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '0'
|
|
53
94
|
- !ruby/object:Gem::Dependency
|
|
54
95
|
name: fun_with_testing
|
|
55
96
|
requirement: !ruby/object:Gem::Requirement
|
|
56
97
|
requirements:
|
|
57
|
-
- - ~>
|
|
98
|
+
- - "~>"
|
|
58
99
|
- !ruby/object:Gem::Version
|
|
59
100
|
version: '0.0'
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 0.0.8
|
|
60
104
|
type: :development
|
|
61
105
|
prerelease: false
|
|
62
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
63
107
|
requirements:
|
|
64
|
-
- - ~>
|
|
108
|
+
- - "~>"
|
|
65
109
|
- !ruby/object:Gem::Version
|
|
66
110
|
version: '0.0'
|
|
111
|
+
- - ">="
|
|
112
|
+
- !ruby/object:Gem::Version
|
|
113
|
+
version: 0.0.8
|
|
67
114
|
description: Dependency for FunWith gems, simplifies the setup of new gems, installing
|
|
68
115
|
version data, root filepath, and default requirements.
|
|
69
116
|
email: keeputahweird@gmail.com
|
|
70
117
|
executables: []
|
|
71
118
|
extensions: []
|
|
72
119
|
extra_rdoc_files:
|
|
120
|
+
- CHANGELOG.markdown
|
|
73
121
|
- LICENSE.txt
|
|
74
122
|
- README.rdoc
|
|
75
123
|
files:
|
|
76
|
-
-
|
|
77
|
-
- ./lib/fun_with/gems/fun_gem_api.rb
|
|
78
|
-
- ./lib/fun_with/gems/gem_api.rb
|
|
79
|
-
- ./lib/fun_with/gems/mechanic.rb
|
|
80
|
-
- ./lib/fun_with/gems/validator.rb
|
|
81
|
-
- ./lib/fun_with_gems.rb
|
|
82
|
-
- ./test/helper.rb
|
|
83
|
-
- ./test/test_fun_with_gems.rb
|
|
84
|
-
- ./test/test_gem/VERSION
|
|
85
|
-
- ./test/test_gem/lib/fun_with/llamas/llama.rb
|
|
86
|
-
- ./test/test_gem/lib/fun_with/llamas/trainer.rb
|
|
87
|
-
- ./test/test_gem/lib/fun_with_llamas.rb
|
|
124
|
+
- ".document"
|
|
88
125
|
- CHANGELOG.markdown
|
|
89
126
|
- Gemfile
|
|
90
127
|
- LICENSE.txt
|
|
91
128
|
- README.rdoc
|
|
129
|
+
- ROADMAP.md
|
|
92
130
|
- Rakefile
|
|
93
131
|
- VERSION
|
|
132
|
+
- lib/fun_with/gems/api_extender.rb
|
|
133
|
+
- lib/fun_with/gems/configuration_installer.rb
|
|
134
|
+
- lib/fun_with/gems/constant_builder.rb
|
|
135
|
+
- lib/fun_with/gems/core_extender.rb
|
|
136
|
+
- lib/fun_with/gems/core_extensions/module.rb
|
|
137
|
+
- lib/fun_with/gems/fun_gem_api.rb
|
|
138
|
+
- lib/fun_with/gems/gem_api.rb
|
|
139
|
+
- lib/fun_with/gems/inclusionizer.rb
|
|
140
|
+
- lib/fun_with/gems/library_requirer.rb
|
|
141
|
+
- lib/fun_with/gems/rake_class_methods.rb
|
|
142
|
+
- lib/fun_with/gems/rakefile.rb
|
|
143
|
+
- lib/fun_with/gems/root_setter.rb
|
|
144
|
+
- lib/fun_with/gems/test_case_extender.rb
|
|
145
|
+
- lib/fun_with/gems/testing/assertions.rb
|
|
146
|
+
- lib/fun_with/gems/testing/gem_to_test_methods.rb
|
|
147
|
+
- lib/fun_with/gems/testing/test_case_extensions.rb
|
|
148
|
+
- lib/fun_with/gems/testing/test_results.rb
|
|
149
|
+
- lib/fun_with/gems/testing/test_setup.rb
|
|
150
|
+
- lib/fun_with/gems/testing/test_suite_runner.rb
|
|
151
|
+
- lib/fun_with/gems/testing/validator.rb
|
|
152
|
+
- lib/fun_with/gems/versionizer.rb
|
|
153
|
+
- lib/fun_with_gems.rb
|
|
154
|
+
- lib/tasks/fun_with/gems/publish.rake
|
|
155
|
+
- lib/tasks/fun_with/gems/validate.rake
|
|
156
|
+
- tasks/empty/empty.rake
|
|
157
|
+
- tasks/empty/environment.rake
|
|
158
|
+
- test/assertions.rb
|
|
159
|
+
- test/data/test_gems/array_inherits_enumerable/VERSION
|
|
160
|
+
- test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable.rb
|
|
161
|
+
- test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable/core_extensions/comparable.rb
|
|
162
|
+
- test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable/core_extensions/enumerable.rb
|
|
163
|
+
- test/data/test_gems/array_inherits_enumerable/lib/array_inherits_enumerable/core_extensions/numeric.rb
|
|
164
|
+
- test/data/test_gems/fun_with_llamas/VERSION
|
|
165
|
+
- test/data/test_gems/fun_with_llamas/lib/fun_with/llamas/gem_api.rb
|
|
166
|
+
- test/data/test_gems/fun_with_llamas/lib/fun_with/llamas/llama.rb
|
|
167
|
+
- test/data/test_gems/fun_with_llamas/lib/fun_with/llamas/trainer.rb
|
|
168
|
+
- test/data/test_gems/fun_with_llamas/lib/fun_with_llamas.rb
|
|
169
|
+
- test/data/test_gems/integer_magic/VERSION
|
|
170
|
+
- test/data/test_gems/integer_magic/config/gem_config.rb
|
|
171
|
+
- test/data/test_gems/integer_magic/lib/integer_magic.rb
|
|
172
|
+
- test/data/test_gems/integer_magic/lib/integer_magic/core_extensions/integer.rb
|
|
173
|
+
- test/data/test_gems/integer_magic/lib/integer_magic/core_extensions/numeric.rb
|
|
174
|
+
- test/helper.rb
|
|
175
|
+
- test/test_core_extensions.rb
|
|
176
|
+
- test/test_fun_with_gems.rb
|
|
177
|
+
- test/test_library_requirer.rb
|
|
178
|
+
- test/test_the_test_case.rb
|
|
179
|
+
- test/test_the_test_gems.rb
|
|
94
180
|
homepage: http://github.com/darthschmoo/fun_with_gems
|
|
95
181
|
licenses:
|
|
96
182
|
- MIT
|
|
97
183
|
metadata: {}
|
|
98
|
-
post_install_message:
|
|
99
184
|
rdoc_options: []
|
|
100
185
|
require_paths:
|
|
101
186
|
- lib
|
|
102
187
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
188
|
requirements:
|
|
104
|
-
- -
|
|
189
|
+
- - ">="
|
|
105
190
|
- !ruby/object:Gem::Version
|
|
106
191
|
version: '0'
|
|
107
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
193
|
requirements:
|
|
109
|
-
- -
|
|
194
|
+
- - ">="
|
|
110
195
|
- !ruby/object:Gem::Version
|
|
111
196
|
version: '0'
|
|
112
197
|
requirements: []
|
|
113
|
-
|
|
114
|
-
rubygems_version: 2.2.2
|
|
115
|
-
signing_key:
|
|
198
|
+
rubygems_version: 4.0.14
|
|
116
199
|
specification_version: 4
|
|
117
|
-
summary:
|
|
200
|
+
summary: 'Dependency for most of my FunWith:: gems. Not much use standalone.'
|
|
118
201
|
test_files: []
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
module FunWith
|
|
2
|
-
module Gems
|
|
3
|
-
|
|
4
|
-
class Mechanic
|
|
5
|
-
def bump_version( gem_const )
|
|
6
|
-
if Validator.new.validate( gem_const )
|
|
7
|
-
# if tests pass and gem is valid
|
|
8
|
-
|
|
9
|
-
# run rake version:bump:patch
|
|
10
|
-
|
|
11
|
-
# git commit
|
|
12
|
-
|
|
13
|
-
# git push
|
|
14
|
-
|
|
15
|
-
# add branch v<VERSION>
|
|
16
|
-
|
|
17
|
-
# rake install
|
|
18
|
-
|
|
19
|
-
# gem push
|
|
20
|
-
|
|
21
|
-
else
|
|
22
|
-
puts "Failed"
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
module FunWith
|
|
2
|
-
module Gems
|
|
3
|
-
class Validator
|
|
4
|
-
TEST_SUITE_DATA_REGEX = /(<?tests>\d+) tests, (<?assertions>\d+) assertions, (<?failures>\d+) failures, (<?errors>\d+) errors, (<?skips>\d+) skips/
|
|
5
|
-
|
|
6
|
-
def self.validate( gem_const )
|
|
7
|
-
self.new( gem_const ).validate
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def initialize( gem_const )
|
|
11
|
-
@gem_const = gem_const
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# should be available via the gem itgem_const?
|
|
15
|
-
def validate
|
|
16
|
-
@fun_gem_errors = []
|
|
17
|
-
|
|
18
|
-
if @gem_const.respond_to?(:root)
|
|
19
|
-
if @gem_const.root.is_a?( FunWith::Files::FilePath )
|
|
20
|
-
@fun_gem_errors << ".root() doesn't exist" unless @gem_const.root.directory?
|
|
21
|
-
@fun_gem_errors << "VERSION file doesn't exist" unless @gem_const.root("VERSION").file?
|
|
22
|
-
@fun_gem_errors << "CHANGELOG.markdown doesn't exist" unless @gem_const.root("CHANGELOG.markdown")
|
|
23
|
-
@fun_gem_errors << "lib directory doesn't exist" unless @gem_const.root("lib").directory?
|
|
24
|
-
else
|
|
25
|
-
@fun_gem_errors << ".root() doesn't give a filepath"
|
|
26
|
-
end
|
|
27
|
-
else
|
|
28
|
-
@fun_gem_errors << "doesn't respond to .root()"
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
if @gem_const.respond_to?(:version)
|
|
32
|
-
|
|
33
|
-
else
|
|
34
|
-
@fun_gem_errors << "doesn't respond to .version()"
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
@fun_gem_errors
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def fun_gem_errors
|
|
41
|
-
@fun_gem_errors
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def passes_tests?( filepath )
|
|
46
|
-
@test_output = `cd #{filepath} && rake`
|
|
47
|
-
results = scan_results( @test_output )
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def scan_results( str )
|
|
51
|
-
if m = str.match( TEST_SUITE_DATA_REGEX )
|
|
52
|
-
m[0]
|
|
53
|
-
else
|
|
54
|
-
"TEST STATS NOT FOUND"
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def git_up_to_date?( filepath )
|
|
60
|
-
# On branch master
|
|
61
|
-
# Your branch is ahead of 'origin/master' by 1 commit.
|
|
62
|
-
# (use "git push" to publish your local commits)
|
|
63
|
-
#
|
|
64
|
-
# nothing to commit, working directory clean
|
|
65
|
-
#
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
File without changes
|
|
File without changes
|