oreilly-snippets 0.0.9 → 0.0.10
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 +13 -5
- data/README.md +1 -2
- data/lib/oreilly/snippets/version.rb +1 -1
- data/lib/oreilly/snippets.rb +8 -4
- data/spec/process_spec.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MTliMzUzMGVmN2RhZjA2MWNmNTVmODMxZGYzYzEwOTNiYzhhNGQzMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ODE2MTBiM2Y0OTJmMjRlY2FjYzA2MDFkNzBjNTYzYWJjZjgwNzM0NQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
M2QzODEyOWI5NzI5NmFkNDQ5ZGUzZTE2ZDViOWQ4ZDRjNzgxYmMwYTUzZTkx
|
10
|
+
MTQyOWU4Y2JkNWQ4YzA2NGU0M2IxNTNjMzc0MTY3NzQ4ZTYyYzg3MjQ5MTU4
|
11
|
+
YzNjMWY0YTc5NDg3MDIzYWExN2Q3OWMxZjJkNmQzMTQ2ODdmNjE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Y2NkYzAxYzYyYWMxOWY4ODc2NWVjZTNlNzk0ZDUzZGMxNTMxM2ZiZWM3NmFh
|
14
|
+
Mjk3YjRjNTU5OTYyZTA0NmNlMzBmNWIyOWVlYjNkMDEzOTAyMzI2YTg3ZjIz
|
15
|
+
MmQxMDZkZmM3MzFiNDY4OWZmODYzOWZhMTlhOThkNjBlMDBkZDk=
|
data/README.md
CHANGED
@@ -144,8 +144,7 @@ if anotherVar == "anotherVar"
|
|
144
144
|
If you want the default to be to flatten (avoiding setting it each
|
145
145
|
snippet declaration), you can set that using the config method: `Oreilly::Snippets.config( flatten: true )`
|
146
146
|
|
147
|
-
At the moment, flattening does not work perfectly for Java files. You can ignore java with `Oreilly::Snippets.config( flatten: true,
|
148
|
-
|
147
|
+
At the moment, flattening does not work perfectly for Java files. You can ignore java with `Oreilly::Snippets.config( flatten: true, skip_flattening: { java: true } )`
|
149
148
|
#### Incompatibilities with Atlas from O'Reilly
|
150
149
|
|
151
150
|
NB: This format of snippets is not currently compatible with Atlas
|
data/lib/oreilly/snippets.rb
CHANGED
@@ -55,8 +55,10 @@ module Oreilly
|
|
55
55
|
rv = contents
|
56
56
|
end
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
unless skip_flattening( language )
|
59
|
+
if ( flatten or @@_config[:flatten] )
|
60
|
+
rv = flatten_it( rv )
|
61
|
+
end
|
60
62
|
end
|
61
63
|
|
62
64
|
rv = "INVALID SNIPPET, WARNING" if error
|
@@ -64,8 +66,10 @@ module Oreilly
|
|
64
66
|
rv
|
65
67
|
end
|
66
68
|
|
67
|
-
def self.
|
68
|
-
|
69
|
+
def self.skip_flattening( language )
|
70
|
+
rv = ( !!@@_config[:skip_flattening] and !!@@_config[:skip_flattening][language.to_sym] )
|
71
|
+
# puts "Skipping flattening for #{language} / #{@@_config[:skip_flattening][language.to_sym]} / #{rv} / (#{@@_config[:skip_flattening].inspect})" if rv
|
72
|
+
rv
|
69
73
|
end
|
70
74
|
|
71
75
|
def self.flatten_it( content )
|
data/spec/process_spec.rb
CHANGED
@@ -216,7 +216,7 @@ describe Oreilly::Snippets do
|
|
216
216
|
// Do something
|
217
217
|
}
|
218
218
|
END
|
219
|
-
Oreilly::Snippets.config( flatten: true,
|
219
|
+
Oreilly::Snippets.config( flatten: true, skip_flattening: { java: true } )
|
220
220
|
output = Oreilly::Snippets.process( DONT_USE_JAVA_FOR_FLATTENING )
|
221
221
|
string.should eq( output )
|
222
222
|
end
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Dawson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,28 +28,28 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - '>='
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - '>='
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Use O'Reilly style snippets inside your markup (asciidoc or markdown)
|
@@ -86,17 +86,17 @@ require_paths:
|
|
86
86
|
- lib
|
87
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- - '>='
|
89
|
+
- - ! '>='
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - '>='
|
94
|
+
- - ! '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.2.
|
99
|
+
rubygems_version: 2.2.5
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: See the README
|