motion-bundler 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.rdoc +5 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/lib/motion-bundler.rb +1 -1
- data/lib/motion-bundler/require.rb +8 -0
- data/lib/motion-bundler/require/resolve.rb +2 -2
- data/lib/motion-bundler/require/tracer/hooks.rb +1 -1
- data/lib/motion-bundler/version.rb +1 -1
- data/sample_app/Rakefile +1 -1
- data/sample_app/app/controllers/app_controller.rb +15 -0
- data/sample_app/lib/foo.rb +0 -1
- data/sample_app/mocks/digest/md5.rb +0 -0
- data/sample_app/mocks/httparty.rb +1 -1
- data/sample_app/mocks/net/protocol.rb +9 -0
- data/sample_app/mocks/openssl.rb +0 -0
- data/sample_app/mocks/socket.rb +0 -0
- data/sample_app/mocks/timeout.rb +4 -0
- data/sample_app/resources/Icon.png +0 -0
- data/sample_app/resources/Icon.pxm +0 -0
- data/sample_app/resources/Icon@2x.png +0 -0
- data/sample_app/resources/Icon@2x.pxm +0 -0
- data/test/.gemfiles/simulator/test_setup.lock +1 -1
- data/test/unit/require/test_resolve.rb +0 -1
- data/test/unit/require/test_ripper.rb +5 -7
- data/test/unit/test_motion-bundler.rb +4 -1
- data/test/unit/test_require.rb +17 -0
- metadata +11 -3
- data/sample_app/resources/Default-568h@2x.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3b46ddc7bfbf054507b9cc9faa9ccbdf66cc1c7
|
4
|
+
data.tar.gz: 5d5c20b2234f96d586022c5631472228b9332f02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ffa0e8ed9ed71638d5fdbeea0a710b882483efdf7a2d086c99919e2f4c11eca84a2e194b9d27964f8290d2cc26740de6b4ae2a5a6efd983d8ef8ab7dbc50d5b
|
7
|
+
data.tar.gz: 28901834c38dd26658f5175fe589764cf9bd6de6dea8bcf5ec8b3e275ff5f5a7bfd71b1780b40fc81cbb53df4aef6d636db234750e30132f790f60378c5a6cc3
|
data/.travis.yml
CHANGED
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
= MotionBundler CHANGELOG
|
2
2
|
|
3
|
+
== Version 0.1.6 (June 14, 2013)
|
4
|
+
|
5
|
+
* Removed optional `strict` argument within Require.resolve
|
6
|
+
* Also mocking within `MotionBundler.tracer_require` (thanks Li Jie for issuing, see https://github.com/archan937/motion-bundler/issues/7)
|
7
|
+
|
3
8
|
== Version 0.1.5 (May 30, 2013)
|
4
9
|
|
5
10
|
* Being able to require multiple files (e.g. `require "./config/**/*.rb"` within `app/app_delegate.rb`)
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ Add `MotionBundler.setup` at the end of your `Rakefile`:
|
|
30
30
|
|
31
31
|
# -*- coding: utf-8 -*-
|
32
32
|
$:.unshift "/Library/RubyMotion/lib"
|
33
|
-
require "motion/project"
|
33
|
+
require "motion/project/template/ios"
|
34
34
|
|
35
35
|
# Require and prepare Bundler
|
36
36
|
require "bundler"
|
@@ -73,4 +73,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
73
73
|
|
74
74
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
75
75
|
|
76
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
76
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/lib/motion-bundler.rb
CHANGED
@@ -2,7 +2,7 @@ module MotionBundler
|
|
2
2
|
module Require
|
3
3
|
module Resolve
|
4
4
|
|
5
|
-
def resolve(path
|
5
|
+
def resolve(path)
|
6
6
|
base_path = path.gsub(/\.rb$/, "")
|
7
7
|
|
8
8
|
load_paths.each do |load_path|
|
@@ -11,7 +11,7 @@ module MotionBundler
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
path
|
14
|
+
path
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
data/sample_app/Rakefile
CHANGED
@@ -8,7 +8,7 @@ Bundler.require
|
|
8
8
|
|
9
9
|
Motion::Project::App.setup do |app|
|
10
10
|
# Use `rake config' to see complete project settings.
|
11
|
-
app.name = "
|
11
|
+
app.name = "MBundler"
|
12
12
|
end
|
13
13
|
|
14
14
|
# Track and specify files and their mutual dependencies within the :motion Bundler group
|
@@ -2,6 +2,7 @@ require "stringio"
|
|
2
2
|
require "strscan"
|
3
3
|
require "zlib"
|
4
4
|
require "httparty"
|
5
|
+
require "net/pop"
|
5
6
|
require_relative "../../lib/foo"
|
6
7
|
|
7
8
|
class AppController < UIViewController
|
@@ -36,6 +37,10 @@ class AppController < UIViewController
|
|
36
37
|
|
37
38
|
p HTTParty.hi!
|
38
39
|
|
40
|
+
# Testing (mocked) Net::Protocol
|
41
|
+
|
42
|
+
p Net::Protocol.hi!
|
43
|
+
|
39
44
|
# Testing Foo and Foo::Bar
|
40
45
|
|
41
46
|
p Foo.foo!
|
@@ -49,5 +54,15 @@ class AppController < UIViewController
|
|
49
54
|
p enc
|
50
55
|
p Base64.decode64(enc)
|
51
56
|
|
57
|
+
# Say thanks
|
58
|
+
|
59
|
+
alert = UIAlertView.new
|
60
|
+
alert.title = "Thanks!"
|
61
|
+
alert.message = "Hi, thanks for giving MotionBundler a try! Any form of collaboration is very welcome.\n\nGreets,\nPaul Engel\n@archan937"
|
62
|
+
alert.show
|
63
|
+
|
64
|
+
count = alert.message.split("\n").collect(&:size).max + 2
|
65
|
+
puts ["", "=" * count, "", alert.title, "", alert.message, "", "=" * count]
|
66
|
+
|
52
67
|
end
|
53
68
|
end
|
data/sample_app/lib/foo.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -15,7 +15,6 @@ module Unit
|
|
15
15
|
MotionBundler::Require::Mocker.expects(:dirs).at_least_once.returns [
|
16
16
|
MotionBundler::Require::Mocker::APP_MOCKS, mocks_dir, MotionBundler::Require::Mocker::GEM_MOCKS
|
17
17
|
]
|
18
|
-
assert_equal nil, Require.resolve("foo", true)
|
19
18
|
assert_equal "foo", Require.resolve("foo")
|
20
19
|
assert_equal "#{mocks_dir}/yaml.rb", Require.resolve("yaml")
|
21
20
|
assert_equal "#{mocks_dir}/net/http.rb", Require.resolve("net/http")
|
@@ -33,10 +33,6 @@ module Unit
|
|
33
33
|
bar_builder.expects(:requires).returns []
|
34
34
|
MotionBundler::Require::Ripper::Builder.expects(:new).with(File.expand_path("./app/controllers/bar.rb")).returns bar_builder
|
35
35
|
|
36
|
-
stringio_builder = mock "object"
|
37
|
-
stringio_builder.expects(:requires).returns []
|
38
|
-
MotionBundler::Require::Ripper::Builder.expects(:new).with("stdlib/stringio.rb").returns stringio_builder
|
39
|
-
|
40
36
|
strscan_builder = mock "object"
|
41
37
|
strscan_builder.expects(:requires).returns []
|
42
38
|
MotionBundler::Require::Ripper::Builder.expects(:new).with("mocks/strscan.rb").returns strscan_builder
|
@@ -45,10 +41,12 @@ module Unit
|
|
45
41
|
lib_baz_builder.expects(:requires).returns []
|
46
42
|
MotionBundler::Require::Ripper::Builder.expects(:new).with("lib/baz.rb").returns lib_baz_builder
|
47
43
|
|
48
|
-
MotionBundler::Require.expects(:resolve).with("stringio").returns("stdlib/stringio.rb")
|
44
|
+
MotionBundler::Require.expects(:resolve).with("stringio").returns("/stdlib/stringio.rb")
|
49
45
|
MotionBundler::Require.expects(:resolve).with("strscan").returns("mocks/strscan.rb")
|
50
46
|
MotionBundler::Require.expects(:resolve).with("baz").returns("lib/baz.rb")
|
51
47
|
|
48
|
+
MotionBundler.expects(:app_require).with("/stdlib/stringio.rb")
|
49
|
+
|
52
50
|
ripper = MotionBundler::Require::Ripper.new(
|
53
51
|
"./app/controllers/app_controller.rb",
|
54
52
|
"./app/controllers/foo_controller.rb",
|
@@ -58,7 +56,7 @@ module Unit
|
|
58
56
|
|
59
57
|
assert_equal([
|
60
58
|
"./app/controllers/app_controller.rb",
|
61
|
-
"stdlib/stringio.rb",
|
59
|
+
"/stdlib/stringio.rb",
|
62
60
|
"mocks/strscan.rb",
|
63
61
|
"./app/controllers/foo_controller.rb",
|
64
62
|
"lib/baz.rb",
|
@@ -67,7 +65,7 @@ module Unit
|
|
67
65
|
], ripper.files)
|
68
66
|
assert_equal({
|
69
67
|
"./app/controllers/app_controller.rb" => [
|
70
|
-
"stdlib/stringio.rb",
|
68
|
+
"/stdlib/stringio.rb",
|
71
69
|
"mocks/strscan.rb"
|
72
70
|
],
|
73
71
|
"./app/controllers/foo_controller.rb" => [
|
@@ -65,7 +65,7 @@ module Unit
|
|
65
65
|
end
|
66
66
|
|
67
67
|
describe "calling `setup`" do
|
68
|
-
it "should require the :motion Bundler group and trace requires" do
|
68
|
+
it "should require the :motion Bundler group and mock and trace requires" do
|
69
69
|
object = mock "object"
|
70
70
|
object.expects :do_something
|
71
71
|
|
@@ -75,6 +75,9 @@ module Unit
|
|
75
75
|
object.do_something
|
76
76
|
end
|
77
77
|
|
78
|
+
MotionBundler::Require.expects(:mock_and_trace)
|
79
|
+
MotionBundler.setup
|
80
|
+
|
78
81
|
MotionBundler.expects(:touch_motion_bundler)
|
79
82
|
MotionBundler.expects(:ripper_require)
|
80
83
|
MotionBundler.expects(:tracer_require)
|
data/test/unit/test_require.rb
CHANGED
@@ -4,6 +4,23 @@ module Unit
|
|
4
4
|
class TestRequire < MiniTest::Unit::TestCase
|
5
5
|
|
6
6
|
describe MotionBundler::Require do
|
7
|
+
it "should be able to mock and trace requirements within a block" do
|
8
|
+
object = mock "object"
|
9
|
+
object.expects :do_something
|
10
|
+
|
11
|
+
MotionBundler::Require.mock_and_trace do
|
12
|
+
object.do_something
|
13
|
+
end
|
14
|
+
|
15
|
+
MotionBundler::Require::Tracer.expects :yield
|
16
|
+
MotionBundler::Require.mock_and_trace do
|
17
|
+
end
|
18
|
+
|
19
|
+
MotionBundler::Require::Mocker.expects :yield
|
20
|
+
MotionBundler::Require.mock_and_trace do
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
7
24
|
it "should be able to trace requirements within a block" do
|
8
25
|
object = mock "object"
|
9
26
|
object.expects :do_something
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Engel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -99,8 +99,16 @@ files:
|
|
99
99
|
- sample_app/app/controllers/app_controller.rb
|
100
100
|
- sample_app/lib/foo.rb
|
101
101
|
- sample_app/lib/foo/bar.rb
|
102
|
+
- sample_app/mocks/digest/md5.rb
|
102
103
|
- sample_app/mocks/httparty.rb
|
103
|
-
- sample_app/
|
104
|
+
- sample_app/mocks/net/protocol.rb
|
105
|
+
- sample_app/mocks/openssl.rb
|
106
|
+
- sample_app/mocks/socket.rb
|
107
|
+
- sample_app/mocks/timeout.rb
|
108
|
+
- sample_app/resources/Icon.png
|
109
|
+
- sample_app/resources/Icon.pxm
|
110
|
+
- sample_app/resources/Icon@2x.png
|
111
|
+
- sample_app/resources/Icon@2x.pxm
|
104
112
|
- sample_app/spec/main_spec.rb
|
105
113
|
- script/console
|
106
114
|
- test/.gemfiles/simulator/test_setup
|
Binary file
|