bobkit 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d96f55c5d526578e5ee34e70855282dfb385db24
4
- data.tar.gz: 85ae03b075ea7a6ff52d8e6e2306c44832d89024
2
+ SHA256:
3
+ metadata.gz: 3d302738a52f6b3b3fdfb412d7f2ddf2ba5e70d6fd86e86723b24656c4fd128d
4
+ data.tar.gz: e17d0e43fc7284018e0b489882a8756d57a482e9c0e873a06b168f9deb6b1680
5
5
  SHA512:
6
- metadata.gz: 301434fd123ce5762da1341aae645aa65f31ffe6155ab87a44feed1019121fa266078da98758c3eafa50a77f9434b945a932e6b7634636140d1cd54dd96964e8
7
- data.tar.gz: 1e28e01af490eefb0d3bf35da91513714e5aa1ef7968a59ca79e0b555d7a515d0114d82955a026cf659e84ce71df7895ab2f435456ff3029b4b73dd06e65b140
6
+ metadata.gz: f7c29a4140a4469b192fdf916907a3193c640b16b7d2db40a09079f0a9550ffa193c5757747cef49d18a78a58bb5eb90a7514682876fae7bc5b518299ef6aef5
7
+ data.tar.gz: c7d49087068e18324b1afc627bc9d7de92230c424519b35637cb9d13ed6bcebad5157383ca2f694ad45a8309fa61d8014d5455c9be447acbbdc1ff1f627774f9
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  Bobkit - Site Generation Toolkit
2
2
  ==================================================
3
3
 
4
- [![Gem](https://img.shields.io/gem/v/bobkit.svg?style=flat-square)](https://rubygems.org/gems/bobkit)
5
- [![Travis](https://img.shields.io/travis/DannyBen/bobkit.svg?style=flat-square)](https://travis-ci.org/DannyBen/bobkit)
6
- [![Code Climate](https://img.shields.io/codeclimate/github/DannyBen/bobkit.svg?style=flat-square)](https://codeclimate.com/github/DannyBen/bobkit)
7
- [![Gemnasium](https://img.shields.io/gemnasium/DannyBen/bobkit.svg?style=flat-square)](https://gemnasium.com/DannyBen/bobkit)
4
+ [![Gem Version](https://badge.fury.io/rb/bobkit.svg)](https://badge.fury.io/rb/bobkit)
5
+ [![Build Status](https://github.com/DannyBen/bobkit/workflows/Test/badge.svg)](https://github.com/DannyBen/bobkit/actions?query=workflow%3ATest)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/64c20ebaaf8ecff0948d/maintainability)](https://codeclimate.com/github/DannyBen/bobkit/maintainability)
8
7
 
9
8
  ---
10
9
 
@@ -74,6 +73,25 @@ compile_css 'main', output: 'style'
74
73
  See more examples in the [Examples folder][1]
75
74
 
76
75
 
76
+ ### DSL or Instance
77
+
78
+ Bobkit was primarily designed as a DSL, but if you wish to use a more scoped
79
+ approach, you can use an instance of the `Bob` class.
80
+
81
+ ```ruby
82
+ require 'bobkit'
83
+
84
+ # Option 1: DSL
85
+ include Bobkit::Tasks
86
+ render ...
87
+ compile_css ...
88
+
89
+ # Option 2: Bob class
90
+ bob = Bob.new
91
+ bob.render ...
92
+ bob.compile_css ...
93
+ ```
94
+
77
95
  Reference
78
96
  --------------------------------------------------
79
97
 
@@ -230,7 +248,7 @@ can use any of these methods.
230
248
  copy_file 'exact/path.zip', 'exact/output/file.zip'
231
249
 
232
250
  # Copy a folder - needed parent folders will be created as needed
233
- copy_file 'exact/path', 'exact/output/folder'
251
+ copy_folder 'exact/path', 'exact/output/folder'
234
252
 
235
253
  # Create folder, and any of the needed parent folders
236
254
  create_folder 'my_folder'
@@ -258,7 +276,7 @@ end
258
276
  ```
259
277
 
260
278
  The watch command is just like
261
- `FileWatcher.new([...]).watch() do |filename, event|`
279
+ `Filewatcher.new([...]).watch() do |filename, event|`
262
280
  with the exception that the array of paths to watch is optional. If none
263
281
  provided, we will watch all the input folders.
264
282
 
@@ -1,7 +1,6 @@
1
1
  require 'i18n'
2
2
  require 'fileutils'
3
- require 'sass'
4
- require 'sass-globbing'
3
+ require 'sasstool'
5
4
  require 'slim'
6
5
  require 'coffee_script'
7
6
  require 'filewatcher'
@@ -13,7 +12,6 @@ require 'bobkit/file_helpers'
13
12
  require 'bobkit/i18n_mixin'
14
13
  require 'bobkit/i18n_bridge'
15
14
  require 'bobkit/scope_options'
16
- require 'bobkit/sass_options'
17
15
  require 'bobkit/sass_bridge'
18
16
  require 'bobkit/slim_options'
19
17
  require 'bobkit/slim_bridge'
@@ -24,3 +22,4 @@ require 'bobkit/watcher'
24
22
 
25
23
  require 'bobkit/scope'
26
24
  require 'bobkit/tasks'
25
+ require 'bobkit/bob'
@@ -0,0 +1,5 @@
1
+ module Bobkit
2
+ class Bob
3
+ include Tasks
4
+ end
5
+ end
@@ -1,15 +1,20 @@
1
1
  module Bobkit
2
2
  module SassBridge
3
3
  include FileHelpers
4
- include SassOptions
5
-
6
- def compile_css(file, options={})
7
- @file = "#{styles_folder}/#{file}.scss"
8
- extended_options = scss_options.merge({ filename: @file })
9
- content = Sass::Engine.new(File.read(@file), extended_options).render
10
- output = options[:output]
11
- create_file "#{css_output_folder}/#{output}.css", content if output
12
- content
4
+
5
+ def compile_css(file, output: nil, source_map: true)
6
+ file = "#{styles_folder}/#{file}.scss"
7
+ sass = Sasstool::Renderer.new file
8
+
9
+ if output
10
+ create_file "#{css_output_folder}/#{output}.css", sass.render
11
+
12
+ if source_map
13
+ create_file "#{css_output_folder}/#{output}.css.map", sass.source_map
14
+ end
15
+ end
16
+
17
+ sass.render
13
18
  end
14
19
  end
15
20
  end
@@ -8,7 +8,6 @@ module Bobkit
8
8
  include I18nBridge
9
9
  include MarkdownBridge
10
10
  include SlimOptions
11
- include SassOptions
12
11
  include ScopeOptions
13
12
  include Assets
14
13
  end
@@ -1,3 +1,3 @@
1
1
  module Bobkit
2
- VERSION = "0.1.5"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -22,7 +22,7 @@ module Bobkit
22
22
  end
23
23
 
24
24
  def filewatcher
25
- FileWatcher.new(paths)
25
+ Filewatcher.new(paths)
26
26
  end
27
27
 
28
28
  protected
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bobkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-04 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slim
@@ -16,42 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '4.0'
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: '3.0'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: sass
28
+ name: sasstool
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.5'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.5'
41
- - !ruby/object:Gem::Dependency
42
- name: sass-globbing
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.1'
33
+ version: '0.1'
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '1.1'
40
+ version: '0.1'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: coffee-script
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,42 +58,42 @@ dependencies:
72
58
  requirements:
73
59
  - - "~>"
74
60
  - !ruby/object:Gem::Version
75
- version: '0.8'
61
+ version: '1.7'
76
62
  type: :runtime
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: '0.8'
68
+ version: '1.7'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: filewatcher
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '0.5'
75
+ version: '1.1'
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: '0.5'
82
+ version: '1.1'
97
83
  - !ruby/object:Gem::Dependency
98
- name: therubyracer
84
+ name: mini_racer
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '0.12'
89
+ version: '0.2'
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
- version: '0.12'
96
+ version: '0.2'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: rdiscount
113
99
  requirement: !ruby/object:Gem::Requirement
@@ -122,76 +108,6 @@ dependencies:
122
108
  - - "~>"
123
109
  - !ruby/object:Gem::Version
124
110
  version: '2.2'
125
- - !ruby/object:Gem::Dependency
126
- name: runfile
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '0.1'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '0.1'
139
- - !ruby/object:Gem::Dependency
140
- name: runfile-tasks
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '0.4'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '0.4'
153
- - !ruby/object:Gem::Dependency
154
- name: byebug
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: '9.0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: '9.0'
167
- - !ruby/object:Gem::Dependency
168
- name: rspec
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - "~>"
172
- - !ruby/object:Gem::Version
173
- version: '3.6'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - "~>"
179
- - !ruby/object:Gem::Version
180
- version: '3.6'
181
- - !ruby/object:Gem::Dependency
182
- name: simplecov
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: '0.15'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: '0.15'
195
111
  description: Site Generation Toolkit with Slim, SCSS, CoffeeScript and Markdown
196
112
  email: db@dannyben.com
197
113
  executables: []
@@ -201,6 +117,7 @@ files:
201
117
  - README.md
202
118
  - lib/bobkit.rb
203
119
  - lib/bobkit/assets.rb
120
+ - lib/bobkit/bob.rb
204
121
  - lib/bobkit/coffee_bridge.rb
205
122
  - lib/bobkit/file_helpers.rb
206
123
  - lib/bobkit/i18n_bridge.rb
@@ -209,7 +126,6 @@ files:
209
126
  - lib/bobkit/markdown_bridge.rb
210
127
  - lib/bobkit/options_base.rb
211
128
  - lib/bobkit/sass_bridge.rb
212
- - lib/bobkit/sass_options.rb
213
129
  - lib/bobkit/scope.rb
214
130
  - lib/bobkit/scope_options.rb
215
131
  - lib/bobkit/slim_bridge.rb
@@ -229,15 +145,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
229
145
  requirements:
230
146
  - - ">="
231
147
  - !ruby/object:Gem::Version
232
- version: 2.0.0
148
+ version: 2.4.0
233
149
  required_rubygems_version: !ruby/object:Gem::Requirement
234
150
  requirements:
235
151
  - - ">="
236
152
  - !ruby/object:Gem::Version
237
153
  version: '0'
238
154
  requirements: []
239
- rubyforge_project:
240
- rubygems_version: 2.6.13
155
+ rubygems_version: 3.1.4
241
156
  signing_key:
242
157
  specification_version: 4
243
158
  summary: Site Generation Toolkit
@@ -1,13 +0,0 @@
1
- module Bobkit
2
- module SassOptions
3
- def scss_options(options=nil)
4
- setopt :scss_options, options, scss_defaults
5
- end
6
- alias_method :sass_options, :scss_options
7
-
8
- def scss_defaults
9
- { cache: true, syntax: :scss, style: :nested,
10
- load_paths: [styles_folder] }
11
- end
12
- end
13
- end