oreilly-snippets 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/oreilly/snippets.rb +1 -1
- data/lib/oreilly/snippets/version.rb +1 -1
- data/spec/process_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a57aed1d32d05bc35423e603bba10ea6b33426d3
|
4
|
+
data.tar.gz: 8331074a515faf1bef013088c32c9712c6d4151d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9d0a940242a3eebd2e62f4a8270fdd3d23bac0f54d99a4281d368a81a0c89408bd56b689a9ea18ccc31339d5e1a145cc8f660591b30e249ef4b0ad23d77acbc
|
7
|
+
data.tar.gz: f883d854dc8b5876d5d09c2920b02510b6f779b1386b7fd416d086b7dfed8a9fb54cf012e3b146cb5b8bc393b08083e1fb5f022ef9c95f7a23156126642cc961
|
data/README.md
CHANGED
@@ -87,6 +87,16 @@ Also, you can specify line numbers and use just certain lines within the file re
|
|
87
87
|
[filename="../../github.js.test", language="js", sha="8e05a916fe0b1a9d3e:coffeetech.js, lines="1..5"]
|
88
88
|
```
|
89
89
|
|
90
|
+
If you want to use a placeholder to remind you to put the correct
|
91
|
+
content in later once you have made the correct commit, use "xxx" as
|
92
|
+
the sha hash.
|
93
|
+
|
94
|
+
```
|
95
|
+
[filename="../../github.js.test", language="js", sha="8e05a916fe0b1a9d3e:coffeetech.js, lines="1..5"]
|
96
|
+
```
|
97
|
+
|
98
|
+
This will get replaced with `PLACEHOLDER TEXT, UPDATE WITH CORRECT SHA HASH`.
|
99
|
+
|
90
100
|
NB: This format of snippets is not currently compatible with Atlas
|
91
101
|
from O'Reilly. However, you can always process the snippet and write
|
92
102
|
out a normal Asciidoc file, a file which will be compatible with
|
data/lib/oreilly/snippets.rb
CHANGED
@@ -18,7 +18,7 @@ module Oreilly
|
|
18
18
|
contents = "PLACEHOLDER TEXT, UPDATE WITH CORRECT SHA HASH"
|
19
19
|
else
|
20
20
|
if numbers
|
21
|
-
sae = numbers.split( ".." ).map { |d| Integer(d)
|
21
|
+
sae = numbers.split( ".." ).map { |d| Integer(d)-1 }
|
22
22
|
line_numbers = [sae[0], sae[1]]
|
23
23
|
end
|
24
24
|
# Use the filename to change into the directory and use git-show
|
data/spec/process_spec.rb
CHANGED
@@ -174,7 +174,7 @@ describe Oreilly::Snippets do
|
|
174
174
|
original = `git show c863f786f5959799d7c11312a7ba1d603ff16339:test.js`
|
175
175
|
Dir.chdir cwd
|
176
176
|
lines = original.split /\n/
|
177
|
-
original = lines[2
|
177
|
+
original = lines[0..2].join "\n"
|
178
178
|
output.strip.should == original.strip
|
179
179
|
end
|
180
180
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oreilly-snippets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Dawson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|