jackbox 0.9.6.6 → 0.9.6.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 +13 -5
- data/LICENSE.lic +0 -0
- data/LICENSE.txt +7 -1
- data/README.md +509 -406
- data/Rakefile +5 -6
- data/Vagrantfile +77 -0
- data/bin/test-jacks +13 -0
- data/jackbox.gemspec +2 -2
- data/lib/jackbox.rb +1 -1
- data/lib/jackbox/examples/dir.rb +2 -7
- data/lib/jackbox/injectors.rb +1 -1
- data/lib/jackbox/injectors/coda.rb +1 -1
- data/lib/jackbox/injectors/prelude.rb +1 -1
- data/lib/jackbox/rake.rb +1 -1
- data/lib/jackbox/tools/prefs.rb +1 -1
- data/lib/jackbox/version.rb +1 -1
- data/spec/bin/jackup_cmd_shared.rb +2 -1
- data/spec/bin/jackup_cmd_spec.rb +4 -7
- data/spec/lib/jackbox/examples/dir_spec.rb +52 -17
- data/spec/lib/jackbox/injector_composition_spec.rb +554 -85
- data/spec/lib/jackbox/injector_inheritance_spec.rb +122 -75
- data/spec/lib/jackbox/injector_introspection_spec.rb +129 -187
- data/spec/lib/jackbox/injector_namespacing_spec.rb +19 -9
- data/spec/lib/jackbox/injector_spec.rb +2 -2
- data/spec/lib/jackbox/injector_versioning_spec.rb +37 -14
- data/spec/lib/jackbox/jiti_rules_spec.rb +536 -272
- data/spec/lib/jackbox/patterns_spec.rb +142 -105
- data/spec/lib/jackbox/prefs_spec.rb +50 -39
- data/spec/lib/jackbox/vmc_spec.rb +33 -28
- data/spec/lib/jackbox_spec.rb +39 -12
- data/spec/spec_helper.rb +33 -89
- data/work +8 -0
- metadata +26 -41
data/spec/lib/jackbox_spec.rb
CHANGED
@@ -70,7 +70,7 @@ describe Jackbox, 'jackbox library', :library do
|
|
70
70
|
|
71
71
|
it 'allows ruby_c objects and singleton classes to be decorated as well' do
|
72
72
|
|
73
|
-
Dir.
|
73
|
+
Dir.metaclass.decorate :chdir do |*args|
|
74
74
|
puts 'Changing directory...'
|
75
75
|
super(*args)
|
76
76
|
end
|
@@ -88,14 +88,13 @@ describe Jackbox, 'jackbox library', :library do
|
|
88
88
|
it 'raises an error when decorating singleton classes without returning them properly' do
|
89
89
|
|
90
90
|
expect {
|
91
|
-
|
92
91
|
class File # MUST USE #singleton_class or #metaclass
|
93
92
|
class << self
|
94
93
|
decorate :chown do |*args| end
|
95
94
|
end
|
96
95
|
end
|
97
96
|
|
98
|
-
}.to raise_error(
|
97
|
+
}.to raise_error(NameError)
|
99
98
|
|
100
99
|
expect {
|
101
100
|
|
@@ -118,11 +117,13 @@ describe Jackbox, 'jackbox library', :library do
|
|
118
117
|
end
|
119
118
|
|
120
119
|
expect {
|
121
|
-
|
122
|
-
|
123
|
-
:boo
|
120
|
+
|
121
|
+
class SomeCrappyClass
|
122
|
+
decorate :boo do
|
123
|
+
:boo
|
124
|
+
end
|
124
125
|
end
|
125
|
-
|
126
|
+
|
126
127
|
}.to raise_error(NameError)
|
127
128
|
end
|
128
129
|
|
@@ -134,11 +135,11 @@ describe Jackbox, 'jackbox library', :library do
|
|
134
135
|
end
|
135
136
|
end
|
136
137
|
|
137
|
-
class
|
138
|
+
class Bc
|
138
139
|
include Am
|
139
140
|
end
|
140
141
|
|
141
|
-
|
142
|
+
Bc.new.off.should == 'off'
|
142
143
|
|
143
144
|
module Am
|
144
145
|
decorate :off do
|
@@ -148,7 +149,7 @@ describe Jackbox, 'jackbox library', :library do
|
|
148
149
|
|
149
150
|
expect {
|
150
151
|
|
151
|
-
|
152
|
+
Bc.new.off.should == 'offon' #fails!!
|
152
153
|
|
153
154
|
}.to raise_error(RSpec::Expectations::ExpectationNotMetError)
|
154
155
|
|
@@ -450,7 +451,7 @@ describe Jackbox, 'jackbox library', :library do
|
|
450
451
|
|
451
452
|
end
|
452
453
|
|
453
|
-
it '
|
454
|
+
it 'runs the same codo on all objects' do
|
454
455
|
|
455
456
|
a = Object.new
|
456
457
|
with a do
|
@@ -469,9 +470,34 @@ describe Jackbox, 'jackbox library', :library do
|
|
469
470
|
|
470
471
|
end
|
471
472
|
|
473
|
+
it 'is not operated as a single array object' do
|
474
|
+
|
475
|
+
expect{
|
476
|
+
x = with 'a', 'b', 'c' do
|
477
|
+
inject { |e, f| e + f }
|
478
|
+
end
|
479
|
+
x.should == 'abc'
|
480
|
+
}.to raise_error(NoMethodError)
|
481
|
+
|
482
|
+
end
|
483
|
+
|
484
|
+
it 'does operate on modules/injectors' do
|
485
|
+
|
486
|
+
trait :a
|
487
|
+
|
488
|
+
with a do
|
489
|
+
def foo
|
490
|
+
:foo
|
491
|
+
end
|
492
|
+
end
|
493
|
+
|
494
|
+
Object.new.extend(a).foo.should == :foo
|
495
|
+
|
496
|
+
end
|
497
|
+
|
472
498
|
it 'raises an error if used with no block' do
|
473
499
|
|
474
|
-
expect{with Object.new}.to raise_error(
|
500
|
+
expect{with Object.new}.to raise_error(ArgumentError)
|
475
501
|
|
476
502
|
end
|
477
503
|
|
@@ -631,6 +657,7 @@ describe Jackbox, 'jackbox library', :library do
|
|
631
657
|
end
|
632
658
|
|
633
659
|
the 'singleton class has a reference to its root class' do
|
660
|
+
# debugger
|
634
661
|
SingletonProber.singleton_class.root().should == SingletonProber
|
635
662
|
end
|
636
663
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -10,47 +10,10 @@ require 'fileutils'
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
module OS
|
22
|
-
def OS.windows?
|
23
|
-
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
|
24
|
-
end
|
25
|
-
|
26
|
-
def OS.mac?
|
27
|
-
(/darwin/ =~ RUBY_PLATFORM) != nil
|
28
|
-
end
|
29
|
-
|
30
|
-
def OS.unix?
|
31
|
-
!OS.windows?
|
32
|
-
end
|
33
|
-
|
34
|
-
def OS.linux?
|
35
|
-
OS.unix? and not OS.mac?
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def system *args
|
40
|
-
pid = spawn(*args)
|
41
|
-
Process.wait(pid, 0)
|
42
|
-
end
|
43
|
-
|
44
|
-
def launch program
|
45
|
-
case
|
46
|
-
when OS.windows?
|
47
|
-
return system "ruby.exe", program if File.exists?(program)
|
48
|
-
system "ruby.exe", '-e', program
|
49
|
-
else
|
50
|
-
return system "ruby", program if File.exists?(program)
|
51
|
-
system "ruby", '-e', program
|
52
|
-
end
|
53
|
-
end
|
13
|
+
# decorate :system do |*args|
|
14
|
+
# pid = spawn(*args)
|
15
|
+
# Process.wait(pid, 0)
|
16
|
+
# end
|
54
17
|
|
55
18
|
def rfolder
|
56
19
|
"#{ENV['HOME']}/tmp/jackbox/#{(0...10).map { ('a'..'z').to_a[rand(26)] }.join}"
|
@@ -65,21 +28,10 @@ RSpec.configure do |config|
|
|
65
28
|
@old_dir = Dir.pwd
|
66
29
|
Dir.chdir @tmpdir
|
67
30
|
end
|
68
|
-
config.after(:suite) do
|
69
|
-
Dir.chdir @old_dir
|
70
|
-
@old_dir = nil
|
71
|
-
FileUtils.rm_rf @tmpdir
|
72
|
-
@tmpdir = nil
|
73
|
-
require "fileutils"
|
74
|
-
end
|
75
31
|
|
76
|
-
config.expect_with :rspec
|
32
|
+
# config.expect_with :rspec
|
33
|
+
config.expect_with(:rspec) { |c| c.syntax = [:expect, :should] }
|
77
34
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
78
|
-
config.alias_it_behaves_like_to :behaves_like, 'behaves like:'
|
79
|
-
config.alias_it_behaves_like_to :behaves_like_it, 'behaves like it:'
|
80
|
-
config.alias_it_behaves_like_to :it_has_behavior, 'has behavior of:'
|
81
|
-
config.alias_it_behaves_like_to :assure, 'assurance of condition:'
|
82
|
-
config.alias_it_behaves_like_to :assure_it, 'assurance it had condition:'
|
83
35
|
config.alias_example_to :they
|
84
36
|
config.alias_example_to :there
|
85
37
|
config.alias_example_to :this
|
@@ -88,52 +40,44 @@ RSpec.configure do |config|
|
|
88
40
|
config.alias_example_to :an
|
89
41
|
config.alias_example_to :the
|
90
42
|
config.alias_example_to :but
|
43
|
+
config.alias_it_behaves_like_to :behaves_like, 'behaves like:'
|
44
|
+
config.alias_it_behaves_like_to :behaves_like_it, 'behaves like it:'
|
45
|
+
config.alias_it_behaves_like_to :it_has_behavior, 'has behavior of:'
|
46
|
+
config.alias_it_behaves_like_to :assure, 'assurance of condition:'
|
47
|
+
config.alias_it_behaves_like_to :assure_it, 'assurance it had condition:'
|
91
48
|
config.color=true
|
92
49
|
config.full_backtrace=true
|
93
50
|
# config.fail_fast = true
|
94
51
|
#config.profile_examples=true
|
95
52
|
# config.include FakeFS::SpecHelpers
|
53
|
+
|
54
|
+
config.after(:suite) do
|
55
|
+
Dir.chdir @old_dir
|
56
|
+
@old_dir = nil
|
57
|
+
FileUtils.rm_rf @tmpdir
|
58
|
+
@tmpdir = nil
|
59
|
+
require "fileutils"
|
60
|
+
end
|
61
|
+
|
96
62
|
end
|
97
63
|
|
64
|
+
|
65
|
+
|
66
|
+
END {
|
67
|
+
FileUtils.rm 'Ex*' rescue false
|
68
|
+
FileUtils.rm '*uget' rescue false
|
69
|
+
FileUtils.rm 'Pers*' rescue false
|
70
|
+
}
|
71
|
+
|
72
|
+
|
73
|
+
|
98
74
|
# stuff needed by all tests
|
99
75
|
require 'jackbox'
|
100
76
|
require 'jackbox/examples/dir'
|
101
77
|
# DX
|
102
78
|
|
103
79
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
#
|
108
|
-
# it 'works according to ruby version' do
|
109
|
-
# if RUBY_VERSION < '2.0.0'
|
110
|
-
# $".grep(/debugger/).should_not be_empty
|
111
|
-
# else
|
112
|
-
# $".grep(/byebug/).should_not be_empty
|
113
|
-
# end
|
114
|
-
# end
|
115
|
-
#
|
116
|
-
# end
|
117
|
-
describe 'os independence', 'provided for by ruby itself' do
|
118
|
-
|
119
|
-
case
|
120
|
-
when OS.windows?
|
121
|
-
it 'works on the windows platform' do
|
122
|
-
launch %{
|
123
|
-
puts RUBY_VERSION
|
124
|
-
}
|
125
|
-
$?.exitstatus.should == 0
|
126
|
-
end
|
127
|
-
else
|
128
|
-
it 'works on *nix platform' do
|
129
|
-
launch %{
|
130
|
-
puts RUBY_VERSION
|
131
|
-
}
|
132
|
-
$?.exitstatus.should == 0
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
end
|
137
|
-
|
138
|
-
end
|
80
|
+
puts '--------------------------------------Starting User Gem Spec------------------------------------------'
|
81
|
+
puts "Ruby Version: #{RUBY_VERSION} for #{RUBY_PLATFORM}"
|
82
|
+
|
139
83
|
|
data/work
ADDED
metadata
CHANGED
@@ -1,92 +1,76 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jackbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.6.
|
4
|
+
version: 0.9.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lou Henry Alvarez (LHA)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 1.6.1
|
20
|
-
- -
|
20
|
+
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: !binary |-
|
23
|
+
MS42
|
23
24
|
type: :runtime
|
24
25
|
prerelease: false
|
25
26
|
version_requirements: !ruby/object:Gem::Requirement
|
26
27
|
requirements:
|
27
|
-
- -
|
28
|
+
- - ! '>='
|
28
29
|
- !ruby/object:Gem::Version
|
29
30
|
version: 1.6.1
|
30
|
-
- -
|
31
|
+
- - ~>
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
+
version: !binary |-
|
34
|
+
MS42
|
33
35
|
- !ruby/object:Gem::Dependency
|
34
36
|
name: thor
|
35
37
|
requirement: !ruby/object:Gem::Requirement
|
36
38
|
requirements:
|
37
|
-
- -
|
39
|
+
- - ! '>='
|
38
40
|
- !ruby/object:Gem::Version
|
39
41
|
version: 0.18.1
|
40
|
-
- -
|
42
|
+
- - ~>
|
41
43
|
- !ruby/object:Gem::Version
|
42
44
|
version: '0.18'
|
43
45
|
type: :runtime
|
44
46
|
prerelease: false
|
45
47
|
version_requirements: !ruby/object:Gem::Requirement
|
46
48
|
requirements:
|
47
|
-
- -
|
49
|
+
- - ! '>='
|
48
50
|
- !ruby/object:Gem::Version
|
49
51
|
version: 0.18.1
|
50
|
-
- -
|
52
|
+
- - ~>
|
51
53
|
- !ruby/object:Gem::Version
|
52
54
|
version: '0.18'
|
53
|
-
|
54
|
-
name: rspec
|
55
|
-
requirement: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - "<="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '3.4'
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: 3.3.0
|
63
|
-
type: :development
|
64
|
-
prerelease: false
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - "<="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '3.4'
|
70
|
-
- - "~>"
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: 3.3.0
|
73
|
-
description: 'Main gem for Ruby Code Injectors: Closures as Modules'
|
55
|
+
description: ! 'Main gem for Ruby Code Injectors: Closures as Modules'
|
74
56
|
email:
|
75
57
|
- luisealvarezb@yahoo.com
|
76
58
|
executables:
|
77
59
|
- jackup
|
60
|
+
- test-jacks
|
78
61
|
extensions: []
|
79
62
|
extra_rdoc_files: []
|
80
63
|
files:
|
81
|
-
-
|
82
|
-
-
|
64
|
+
- .gitignore
|
65
|
+
- .yardopts
|
83
66
|
- CHANGES.txt
|
84
67
|
- LICENSE.lic
|
85
68
|
- LICENSE.txt
|
86
69
|
- README.md
|
87
70
|
- Rakefile
|
71
|
+
- Vagrantfile
|
88
72
|
- bin/jackup
|
89
|
-
-
|
73
|
+
- bin/test-jacks
|
90
74
|
- jackbox.gemspec
|
91
75
|
- jackbox.jpg
|
92
76
|
- lib/.document
|
@@ -169,6 +153,7 @@ files:
|
|
169
153
|
- spec/lib/jackbox/vmc_spec.rb
|
170
154
|
- spec/lib/jackbox_spec.rb
|
171
155
|
- spec/spec_helper.rb
|
156
|
+
- work
|
172
157
|
homepage: http://jackbox.us
|
173
158
|
licenses:
|
174
159
|
- Copyright © 2014, 2015 LHA. All rights reserved. See LICENSE.txt
|
@@ -179,22 +164,22 @@ require_paths:
|
|
179
164
|
- lib
|
180
165
|
required_ruby_version: !ruby/object:Gem::Requirement
|
181
166
|
requirements:
|
182
|
-
- -
|
167
|
+
- - ! '>='
|
183
168
|
- !ruby/object:Gem::Version
|
184
169
|
version: '0'
|
185
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
171
|
requirements:
|
187
|
-
- -
|
172
|
+
- - ! '>='
|
188
173
|
- !ruby/object:Gem::Version
|
189
174
|
version: '0'
|
190
175
|
requirements: []
|
191
176
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.4.
|
177
|
+
rubygems_version: 2.4.8
|
193
178
|
signing_key:
|
194
179
|
specification_version: 4
|
195
180
|
summary: Jackbox is a set of programming tools which enhance the Ruby language and
|
196
|
-
provide some additional software constructs. Main library for Modular Closures,
|
197
|
-
|
181
|
+
provide some additional software constructs. Main library for Ruby Modular Closures,
|
182
|
+
Traits, Code Injectors, class constructors, and other Ruby programmer morphins.
|
198
183
|
test_files:
|
199
184
|
- spec/bin/jackup_cmd_shared.rb
|
200
185
|
- spec/bin/jackup_cmd_spec.rb
|