oreilly-snippets 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15d1d4d047093c3b43eb0806790c3fa563cc67ac
4
- data.tar.gz: 015db5a432fa389c815269492ac308232bdee236
3
+ metadata.gz: a57aed1d32d05bc35423e603bba10ea6b33426d3
4
+ data.tar.gz: 8331074a515faf1bef013088c32c9712c6d4151d
5
5
  SHA512:
6
- metadata.gz: c5d8bc7dcd875d854fb43339c3d599f93f3d6a7127b1af19f3dd3d67548b436577e6f3f0052be283528ba74e3b74d2996f35d4bff26957f8ba712f7c4b709fc3
7
- data.tar.gz: 1c83c25ab9d7b3bea22ab4f51fd17d937470f14f780ecaa78437f17c831222b9eeaef8657f6f6397dad10c537ac352dc6f7a19a4aa5274f26e3b1b2a0297ad1e
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
@@ -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)+1 }
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
@@ -1,5 +1,5 @@
1
1
  module Oreilly
2
2
  module Snippets
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
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..4].join "\n"
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
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-07 00:00:00.000000000 Z
11
+ date: 2014-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler