motion_print 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +24 -6
- data/motion/motion_print/motion_print.rb +7 -3
- data/motion/motion_print/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1e14d0022a0e5d1fc191558ecfe2c57005b666d
|
4
|
+
data.tar.gz: f3b3d8cba96dab4f8b490ebc15cf9f50b4effd86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f469c95aaa9f7e5b13eb4d06eba6b939edad8ad0e44928fe43798da339320c75429ecfa7cb8a2c6cc2d2b4fd0d2542cdb9ff0e9305d7101755e6bf6c9e4bd3f
|
7
|
+
data.tar.gz: 85c69e3a07248eda2b9b0aa6c580d97623dfc1320c7625073344b047375e287dc38c01dff98efe2ea851678fec64f8bfa801068f47886eeef93176467c69697e
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
A RubyMotion pretty printer.
|
4
4
|
|
5
|
-
[](http://badge.fury.io/rb/motion_print) [](https://travis-ci.org/MohawkApps/motion_print) [](https://codeclimate.com/github/MohawkApps/motion_print)
|
5
|
+
[](http://badge.fury.io/rb/motion_print) [](https://travis-ci.org/MohawkApps/motion_print) [](https://codeclimate.com/github/MohawkApps/motion_print)
|
6
6
|
|
7
7
|
instead of using `p` or `puts`, use `mp` to log your debug values to the RubyMotion REPL.
|
8
8
|
|
@@ -10,6 +10,9 @@ instead of using `p` or `puts`, use `mp` to log your debug values to the RubyMot
|
|
10
10
|
|
11
11
|
<small>Colors don't show up correctly on github, so these are just examples of what you can do with `motion_print`. Try it out for yourself to see the more colorful output!</small>
|
12
12
|
|
13
|
+

|
14
|
+
|
15
|
+
|
13
16
|
```ruby
|
14
17
|
mp "a string"
|
15
18
|
|
@@ -26,9 +29,9 @@ mp :some_symbol
|
|
26
29
|
mp [1, 'two', :three, 4.0]
|
27
30
|
|
28
31
|
[
|
29
|
-
1,
|
30
|
-
'two',
|
31
|
-
:three,
|
32
|
+
1,
|
33
|
+
'two',
|
34
|
+
:three,
|
32
35
|
4.0
|
33
36
|
]
|
34
37
|
```
|
@@ -37,8 +40,8 @@ mp [1, 'two', :three, 4.0]
|
|
37
40
|
mp({b: "bee", a: 'a', see: 4})
|
38
41
|
|
39
42
|
{
|
40
|
-
a => a,
|
41
|
-
b => bee,
|
43
|
+
a => a,
|
44
|
+
b => bee,
|
42
45
|
see => 4
|
43
46
|
}
|
44
47
|
```
|
@@ -73,6 +76,10 @@ I used to be a big fan of [awesome_print_motion](https://github.com/michaeldv/aw
|
|
73
76
|
|
74
77
|
That, coupled with the fact that the developer of awesome_print_motion doesn't seem responsive to [issues](https://github.com/michaeldv/awesome_print_motion/issues) or [pull requests](https://github.com/michaeldv/awesome_print_motion/pulls), I decided to roll my own debugging tool specifically written for RubyMotion development.
|
75
78
|
|
79
|
+
`awesome_print_motion` is 793 lines of code and extends `Array`, `Kernel`, `Class`, and `Object`, and is _not_ tested.
|
80
|
+
|
81
|
+
`motion_print` is 152 lines of code, adds one method each to `String`, and `Kernel`, and is _fully_ tested (run `rake spec` to see the tests pass).
|
82
|
+
|
76
83
|
## Contributing
|
77
84
|
|
78
85
|
1. Fork it
|
@@ -80,3 +87,14 @@ That, coupled with the fact that the developer of awesome_print_motion doesn't s
|
|
80
87
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
81
88
|
4. Push to the branch (`git push origin my-new-feature`)
|
82
89
|
5. Create new Pull Request
|
90
|
+
|
91
|
+
## Contact
|
92
|
+
|
93
|
+
Mark Rickert ([http://www.mohawkapps.com](http://www.mohawkapps.com))
|
94
|
+
|
95
|
+
- [http://twitter.com/markrickert](http://twitter.com/markrickert)
|
96
|
+
- [mark@mohawkapps.com](mark@mohawkapps.com)
|
97
|
+
|
98
|
+
## License
|
99
|
+
|
100
|
+
motion_print is available under the MIT license. See the LICENSE file for more info.
|
@@ -59,7 +59,7 @@ module MotionPrint
|
|
59
59
|
else
|
60
60
|
v = logger(value)
|
61
61
|
end
|
62
|
-
out << (align(key, width, indent_level) <<
|
62
|
+
out << (align(key, width, indent_level) << hash_rocket << v)
|
63
63
|
end
|
64
64
|
|
65
65
|
"{\n" << out.join(",\n") << "\n#{indent_by(indent_level-1)}}"
|
@@ -71,12 +71,16 @@ module MotionPrint
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def l_symbol(object)
|
74
|
-
colorize(
|
74
|
+
colorize(object, object)
|
75
75
|
end
|
76
76
|
|
77
77
|
def colorize(object, type = nil)
|
78
78
|
type = object if type.nil?
|
79
|
-
Colorizer.send(decide_color(type), object)
|
79
|
+
Colorizer.send(decide_color(type), object.inspect)
|
80
|
+
end
|
81
|
+
|
82
|
+
def hash_rocket
|
83
|
+
Colorizer.send(decide_color(:hash), " => ")
|
80
84
|
end
|
81
85
|
|
82
86
|
def decide_color(object)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bacon
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description: motion_print is a RubyMotion friendly console logger and
|
41
|
+
description: motion_print is a RubyMotion friendly console logger and debugging tool.
|
42
42
|
email:
|
43
43
|
- mjar81@gmail.com
|
44
44
|
executables: []
|