seeing_is_believing 2.0.2 → 2.0.3
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 +2 -2
- data/lib/seeing_is_believing/version.rb +1 -1
- data/lib/seeing_is_believing/wrap_expressions.rb +0 -27
- data/seeing_is_believing.gemspec +1 -1
- data/spec/wrap_expressions_spec.rb +1 -3
- metadata +4 -5
- data/textmate-integration.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: 6f3a33ebd46b9d9da1919b82f9a1d455f364a6fc
|
4
|
+
data.tar.gz: 2fef2e75ad635f67bc2ebc3c6d25a9d5ec1bd56b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 588f7d2d54999b825c89f6a3fa809b09ba240fce0f42921afb0f4bee396a5a9b8cc6b7443d4580316d8cdf1887537af4323c7233870dc3660c3bffba5240c27d
|
7
|
+
data.tar.gz: 34f1c84303fe466b2b004b7e4017467475c4c305235e14c1f3c761b5214879d539e49f27155d8f05ce0ef3c1ff8a00a9b0ffdb231aaa4116ff4d82a45bc84716
|
data/Readme.md
CHANGED
@@ -9,7 +9,7 @@ Except, obviously, his is like a million times better.
|
|
9
9
|
|
10
10
|
Also comes with a binary to show how it might be used.
|
11
11
|
|
12
|
-
For whatever reason, I can't embed videos, but **here's a
|
12
|
+
For whatever reason, I can't embed videos, but **here's a [video](vimeo.com/73866851)** showing it off.
|
13
13
|
|
14
14
|
Works in Ruby 1.9 and 2.0
|
15
15
|
|
@@ -19,7 +19,7 @@ Use The Binary
|
|
19
19
|
```ruby
|
20
20
|
$ cat simple_example.rb
|
21
21
|
5.times do |i|
|
22
|
-
|
22
|
+
i * 2
|
23
23
|
end
|
24
24
|
|
25
25
|
|
@@ -1,33 +1,6 @@
|
|
1
1
|
require 'parser/current'
|
2
2
|
require 'seeing_is_believing/parser_helpers'
|
3
3
|
|
4
|
-
# hack rewriter to apply insertions in stable order
|
5
|
-
# until https://github.com/whitequark/parser/pull/102 gets released
|
6
|
-
module Parser
|
7
|
-
module Source
|
8
|
-
class Rewriter
|
9
|
-
def process
|
10
|
-
adjustment = 0
|
11
|
-
source = @source_buffer.source.dup
|
12
|
-
sorted_queue = @queue.sort_by.with_index do |action, index|
|
13
|
-
[action.range.begin_pos, index]
|
14
|
-
end
|
15
|
-
sorted_queue.each do |action|
|
16
|
-
begin_pos = action.range.begin_pos + adjustment
|
17
|
-
end_pos = begin_pos + action.range.length
|
18
|
-
|
19
|
-
source[begin_pos...end_pos] = action.replacement
|
20
|
-
|
21
|
-
adjustment += (action.replacement.length - action.range.length)
|
22
|
-
end
|
23
|
-
|
24
|
-
source
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
4
|
# comprehensive list of syntaxes that can come up
|
32
5
|
# https://github.com/whitequark/parser/blob/master/doc/AST_FORMAT.md
|
33
6
|
class SeeingIsBelieving
|
data/seeing_is_believing.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency "parser", "= 2.0.0.
|
22
|
+
s.add_dependency "parser", "= 2.0.0.pre8"
|
23
23
|
|
24
24
|
s.add_development_dependency "haiti", "~> 0.0.3"
|
25
25
|
s.add_development_dependency "rake", "~> 10.0.3"
|
@@ -752,9 +752,7 @@ describe SeeingIsBelieving::WrapExpressions do
|
|
752
752
|
wrap("-> { }").should == "<-> { }>"
|
753
753
|
wrap("-> a, b { }").should == "<-> a, b { }>"
|
754
754
|
wrap("-> {\n1\n}").should == "<-> {\n<1>\n}>"
|
755
|
-
|
756
|
-
wrap("-> * { }").should == "<-> * { }>"
|
757
|
-
end
|
755
|
+
wrap("-> * { }").should == "<-> * { }>"
|
758
756
|
end
|
759
757
|
|
760
758
|
it 'wraps the full invocation' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seeing_is_believing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Cheek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.0.
|
19
|
+
version: 2.0.0.pre8
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.0.
|
26
|
+
version: 2.0.0.pre8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: haiti
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +151,6 @@ files:
|
|
151
151
|
- spec/line_spec.rb
|
152
152
|
- spec/seeing_is_believing_spec.rb
|
153
153
|
- spec/wrap_expressions_spec.rb
|
154
|
-
- textmate-integration.png
|
155
154
|
homepage: https://github.com/JoshCheek/seeing_is_believing
|
156
155
|
licenses:
|
157
156
|
- WTFPL
|
data/textmate-integration.png
DELETED
Binary file
|