fanforce-app-factory 2.0.0.rc22 → 2.0.0.rc23

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.0.0-p576
1
+ 1.9.3-p194
@@ -60,7 +60,7 @@ class Fanforce::AppFactory::CLI::Bitbucket
60
60
  console_command('git branch -u bitbucket/master')
61
61
  log "#{'Connected '.format(:green,:bold)}" + 'upstream to bitbucket/master'
62
62
  else
63
- log "#{'Found '.format(:green,:bold)}" + 'upstream connected to bitbucket/master'
63
+ log "#{'Found '.format(:green,:bold)}" + 'upstream connection to bitbucket/master'
64
64
  end
65
65
 
66
66
  log "#{'Pushing '.format(:green,:bold)}" + 'latest commit to bitbucket/master...'
@@ -1,2 +1,3 @@
1
1
  fanforce-app-factory-2.0.0.rc6:92bc47f80382ad2123eaf5eb4b1ab17ab60f63ef
2
2
  fanforce-app-factory-2.0.0.rc6:346d7c19f0887e96ffd2783ef174af6ff147eb84
3
+ fanforce-app-factory-2.0.0.rc23:af90492fbf4ca65bce0f8f783052f78749da87b7
@@ -7,19 +7,11 @@
7
7
 
8
8
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
9
9
 
10
+ @import 'app_factory/bootstrap';
10
11
  @import 'app_factory/common';
11
12
 
12
13
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
13
14
 
14
- h1, .h1 { font-size: 30px; font-weight:bold; margin:10px 0; line-height:1em; }
15
- h2, .h2 { font-size: 20px; font-weight:bold; margin:8px 0; line-height:1em; }
16
- h3, .h3 { font-size: 17px; font-weight:bold; margin:6px 0; line-height:1em; }
17
- h4, .h4 { font-size: 14px; font-weight:bold; margin:4px 0; line-height:1em; }
18
- h5, .h5 { font-size: 13px; font-weight: bold; margin:2px 0; line-height:1em; }
19
- h6, .h6 { font-size: 12px; font-weight: bold; margin:2px 0; line-height:1em; }
20
- h7, .h7 { font-size: 11px; font-weight: bold; margin:2px 0; line-height:1em; }
21
-
22
- p, .p { line-height:1.5em; margin-bottom:10px; }
23
15
  a { text-decoration:none; color:#1861a8;
24
16
  &:hover { text-decoration:underline; }
25
17
  }
@@ -12,6 +12,7 @@ class Fanforce::App::Sinatra < Sinatra::Base
12
12
  require_relative 'helpers/ractive'
13
13
  require_relative 'helpers/json'
14
14
  require_relative 'helpers/fanforce'
15
+ require_relative 'helpers/css_frameworks'
15
16
 
16
17
  use Rack::JSONR, :method_override => :all
17
18
  use Bugsnag::Rack
@@ -2,7 +2,7 @@ class Fanforce::App::Sinatra
2
2
 
3
3
  def route_widget_templates
4
4
  content_type 'application/javascript'
5
- page :widget_templates
5
+ page :widget_templates, css_framework: params[:css_framework]
6
6
  end
7
7
 
8
8
  end
@@ -0,0 +1,70 @@
1
+ require 'haml'
2
+ require 'haml/compiler'
3
+
4
+ class Haml::Options
5
+ attr_accessor :css_framework
6
+
7
+ def self.defaults
8
+ @defaults[:css_framework] ||= nil
9
+ @defaults
10
+ end
11
+
12
+ def css_framework=(framework)
13
+ case framework.to_s.downcase.to_sym
14
+ when :foundation5 then @css_framework = :foundation5
15
+ when :bootstrap3 then @css_framework = :bootstrap3
16
+ else @css_framework = nil
17
+ end
18
+ end
19
+ end
20
+
21
+ class Haml::Compiler
22
+ FRAMEWORKS = {
23
+ foundation5: {
24
+ tags: {},
25
+ classes: [
26
+ {regexp: 'col-width(\d+)', class: 'small-12 medium-{{1}} column'}
27
+ ]
28
+ },
29
+ bootstrap3: {
30
+ tags: {
31
+ input: {class: 'form-control'},
32
+ select: {class: 'form-control'}
33
+ },
34
+ classes: [
35
+ {regexp: 'col-width(\d+)', class: 'col-md-{{1}}'},
36
+ {regexp: 'form-row', class: 'form-group'}
37
+ ]
38
+ }
39
+ }
40
+
41
+ def compile(node)
42
+ parent, @node = @node, node
43
+
44
+ if node.children.empty?
45
+ precompile_tag if node.type == :tag
46
+ send(:"compile_#{node.type}")
47
+ else
48
+ precompile_tag if node.type == :tag
49
+ send(:"compile_#{node.type}") {node.children.each {|c| compile c}}
50
+ end
51
+ ensure
52
+ @node = parent
53
+ end
54
+
55
+ def precompile_tag
56
+ if @options.css_framework
57
+ framework = FRAMEWORKS[@options.css_framework]
58
+ if @node.value[:name].present? and framework[:tags][@node.value[:name].to_sym]
59
+ @node.value[:attributes]['class'] = "#{@node.value[:attributes]['class'].to_s.strip} #{framework[:tags][@node.value[:name].to_sym][:class]}"
60
+ end
61
+ framework[:classes].each do |class_obj|
62
+ class_str = " #{@node.value[:attributes]['class']} "
63
+ regexp = Regexp.new(" #{class_obj[:regexp]} ")
64
+ if regexp.match(class_str)
65
+ @node.value[:attributes]['class'] = (class_str.gsub(regexp, ' ') + class_obj[:class].gsub('{{1}}', $1.to_s)).strip
66
+ end
67
+ end if @node.value[:attributes]['class']
68
+ end
69
+ end
70
+ end
@@ -2,29 +2,22 @@ module Fanforce::App::Sinatra::RactiveHelpers
2
2
 
3
3
  # Creates a string representation of a javascript object for ractive.js
4
4
  def compile_ractive_templates(options={}, &block)
5
- context = Object.new
6
- class << context
7
- include Haml::Helpers
8
- end
9
- context.init_haml_helpers
10
-
11
5
  format = options[:format] == 'html' ? :html : :json
6
+ context = create_context
12
7
 
13
- return context.capture_haml(&block) if format == :html
14
- single_line_html = context.capture_haml(&block).split(/\r?\n/).inject('') {|sl, l| sl += l.strip + ' ' }
15
- matches = single_line_html.scan(/<script id=[\"'](.*?)[\"'](?:.*?)>(.*?)(?:<\/script>)/mi)
8
+ html = context.capture_haml(&block)
9
+ return html if format == :html
16
10
 
11
+ single_line_html = html.split(/\r?\n/).inject('') {|sl, l| sl += l.strip + ' ' }
12
+ matches = single_line_html.scan(/<script id=[\"'](.*?)[\"'](?:.*?)>(.*?)(?:<\/script>)/mi)
17
13
  matches.inject({}) {|t,m| t[m[0]] = m[1]; t }.to_json
18
14
  end
19
15
 
20
16
  def RACTIVE(helper, &block)
21
17
  begin require 'haml' rescue LoadError raise 'You must have the haml gem installed to use Fanforce.compile_jquery_templates.' end
22
- raise ArgumentError, "Missing block" unless block_given?
23
- context = Object.new
24
- class << context
25
- include Haml::Helpers
26
- end
27
- context.init_haml_helpers
18
+ raise ArgumentError, 'Missing block' unless block_given?
19
+
20
+ context = create_context
28
21
  helper = '#'+helper if helper !~ /^[#\^]/
29
22
  "{{#{helper}}}\n" + context.capture_haml(&block) + "{{/#{helper.gsub(/(#|\^)/,'')}}}"
30
23
  end
@@ -41,17 +34,12 @@ module Fanforce::App::Sinatra::RactiveHelpers
41
34
  RACTIVE(helper, &block)
42
35
  end
43
36
 
44
- def column(size, &block)
45
- begin require 'haml' rescue LoadError raise 'You must have the haml gem installed to use Fanforce.compile_jquery_templates.' end
46
- if block
47
- context = Object.new
48
- class << context
49
- include Haml::Helpers
50
- end
51
- context.init_haml_helpers
52
- html = context.capture_haml(&block)
37
+ def create_context
38
+ context = Object.new
39
+ class << context
40
+ include Haml::Helpers
53
41
  end
54
- "<div class='small-12 medium-#{size} column'>\n#{html}</div>"
42
+ context.init_haml_helpers
43
+ context
55
44
  end
56
-
57
45
  end
@@ -1,5 +1,5 @@
1
1
  class Fanforce
2
2
  class AppFactory
3
- VERSION = '2.0.0.rc22'
3
+ VERSION = '2.0.0.rc23'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanforce-app-factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc22
4
+ version: 2.0.0.rc23
5
+ prerelease: 6
5
6
  platform: ruby
6
7
  authors:
7
8
  - Caleb Clark
@@ -13,6 +14,7 @@ dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: redis
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: sinatra
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,6 +62,7 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: sinatra-contrib
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
67
  - - ~>
60
68
  - !ruby/object:Gem::Version
@@ -62,6 +70,7 @@ dependencies:
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
75
  - - ~>
67
76
  - !ruby/object:Gem::Version
@@ -69,6 +78,7 @@ dependencies:
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: rack-contrib
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ~>
74
84
  - !ruby/object:Gem::Version
@@ -76,6 +86,7 @@ dependencies:
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
91
  - - ~>
81
92
  - !ruby/object:Gem::Version
@@ -83,6 +94,7 @@ dependencies:
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: haml
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
99
  - - ~>
88
100
  - !ruby/object:Gem::Version
@@ -90,6 +102,7 @@ dependencies:
90
102
  type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
107
  - - ~>
95
108
  - !ruby/object:Gem::Version
@@ -97,6 +110,7 @@ dependencies:
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: coffee-script
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
115
  - - ~>
102
116
  - !ruby/object:Gem::Version
@@ -104,6 +118,7 @@ dependencies:
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
123
  - - ~>
109
124
  - !ruby/object:Gem::Version
@@ -111,6 +126,7 @@ dependencies:
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: sass
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
131
  - - ~>
116
132
  - !ruby/object:Gem::Version
@@ -118,6 +134,7 @@ dependencies:
118
134
  type: :runtime
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
139
  - - ~>
123
140
  - !ruby/object:Gem::Version
@@ -125,6 +142,7 @@ dependencies:
125
142
  - !ruby/object:Gem::Dependency
126
143
  name: compass
127
144
  requirement: !ruby/object:Gem::Requirement
145
+ none: false
128
146
  requirements:
129
147
  - - ~>
130
148
  - !ruby/object:Gem::Version
@@ -132,6 +150,7 @@ dependencies:
132
150
  type: :runtime
133
151
  prerelease: false
134
152
  version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
135
154
  requirements:
136
155
  - - ~>
137
156
  - !ruby/object:Gem::Version
@@ -139,6 +158,7 @@ dependencies:
139
158
  - !ruby/object:Gem::Dependency
140
159
  name: sprockets
141
160
  requirement: !ruby/object:Gem::Requirement
161
+ none: false
142
162
  requirements:
143
163
  - - ~>
144
164
  - !ruby/object:Gem::Version
@@ -146,6 +166,7 @@ dependencies:
146
166
  type: :runtime
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
149
170
  requirements:
150
171
  - - ~>
151
172
  - !ruby/object:Gem::Version
@@ -153,6 +174,7 @@ dependencies:
153
174
  - !ruby/object:Gem::Dependency
154
175
  name: sprockets-sass
155
176
  requirement: !ruby/object:Gem::Requirement
177
+ none: false
156
178
  requirements:
157
179
  - - ~>
158
180
  - !ruby/object:Gem::Version
@@ -160,6 +182,7 @@ dependencies:
160
182
  type: :runtime
161
183
  prerelease: false
162
184
  version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
163
186
  requirements:
164
187
  - - ~>
165
188
  - !ruby/object:Gem::Version
@@ -167,6 +190,7 @@ dependencies:
167
190
  - !ruby/object:Gem::Dependency
168
191
  name: yui-compressor
169
192
  requirement: !ruby/object:Gem::Requirement
193
+ none: false
170
194
  requirements:
171
195
  - - ~>
172
196
  - !ruby/object:Gem::Version
@@ -174,6 +198,7 @@ dependencies:
174
198
  type: :runtime
175
199
  prerelease: false
176
200
  version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
177
202
  requirements:
178
203
  - - ~>
179
204
  - !ruby/object:Gem::Version
@@ -181,6 +206,7 @@ dependencies:
181
206
  - !ruby/object:Gem::Dependency
182
207
  name: uglifier
183
208
  requirement: !ruby/object:Gem::Requirement
209
+ none: false
184
210
  requirements:
185
211
  - - ~>
186
212
  - !ruby/object:Gem::Version
@@ -188,6 +214,7 @@ dependencies:
188
214
  type: :runtime
189
215
  prerelease: false
190
216
  version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
191
218
  requirements:
192
219
  - - ~>
193
220
  - !ruby/object:Gem::Version
@@ -195,6 +222,7 @@ dependencies:
195
222
  - !ruby/object:Gem::Dependency
196
223
  name: therubyracer
197
224
  requirement: !ruby/object:Gem::Requirement
225
+ none: false
198
226
  requirements:
199
227
  - - ~>
200
228
  - !ruby/object:Gem::Version
@@ -202,6 +230,7 @@ dependencies:
202
230
  type: :runtime
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
205
234
  requirements:
206
235
  - - ~>
207
236
  - !ruby/object:Gem::Version
@@ -209,6 +238,7 @@ dependencies:
209
238
  - !ruby/object:Gem::Dependency
210
239
  name: bugsnag
211
240
  requirement: !ruby/object:Gem::Requirement
241
+ none: false
212
242
  requirements:
213
243
  - - ~>
214
244
  - !ruby/object:Gem::Version
@@ -216,6 +246,7 @@ dependencies:
216
246
  type: :runtime
217
247
  prerelease: false
218
248
  version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
219
250
  requirements:
220
251
  - - ~>
221
252
  - !ruby/object:Gem::Version
@@ -223,6 +254,7 @@ dependencies:
223
254
  - !ruby/object:Gem::Dependency
224
255
  name: rack-jsonr
225
256
  requirement: !ruby/object:Gem::Requirement
257
+ none: false
226
258
  requirements:
227
259
  - - ~>
228
260
  - !ruby/object:Gem::Version
@@ -230,6 +262,7 @@ dependencies:
230
262
  type: :runtime
231
263
  prerelease: false
232
264
  version_requirements: !ruby/object:Gem::Requirement
265
+ none: false
233
266
  requirements:
234
267
  - - ~>
235
268
  - !ruby/object:Gem::Version
@@ -237,6 +270,7 @@ dependencies:
237
270
  - !ruby/object:Gem::Dependency
238
271
  name: rest_client
239
272
  requirement: !ruby/object:Gem::Requirement
273
+ none: false
240
274
  requirements:
241
275
  - - '='
242
276
  - !ruby/object:Gem::Version
@@ -244,6 +278,7 @@ dependencies:
244
278
  type: :runtime
245
279
  prerelease: false
246
280
  version_requirements: !ruby/object:Gem::Requirement
281
+ none: false
247
282
  requirements:
248
283
  - - '='
249
284
  - !ruby/object:Gem::Version
@@ -251,6 +286,7 @@ dependencies:
251
286
  - !ruby/object:Gem::Dependency
252
287
  name: fanforce-base
253
288
  requirement: !ruby/object:Gem::Requirement
289
+ none: false
254
290
  requirements:
255
291
  - - ~>
256
292
  - !ruby/object:Gem::Version
@@ -258,6 +294,7 @@ dependencies:
258
294
  type: :runtime
259
295
  prerelease: false
260
296
  version_requirements: !ruby/object:Gem::Requirement
297
+ none: false
261
298
  requirements:
262
299
  - - ~>
263
300
  - !ruby/object:Gem::Version
@@ -265,6 +302,7 @@ dependencies:
265
302
  - !ruby/object:Gem::Dependency
266
303
  name: fanforce-api
267
304
  requirement: !ruby/object:Gem::Requirement
305
+ none: false
268
306
  requirements:
269
307
  - - ~>
270
308
  - !ruby/object:Gem::Version
@@ -272,6 +310,7 @@ dependencies:
272
310
  type: :runtime
273
311
  prerelease: false
274
312
  version_requirements: !ruby/object:Gem::Requirement
313
+ none: false
275
314
  requirements:
276
315
  - - ~>
277
316
  - !ruby/object:Gem::Version
@@ -279,6 +318,7 @@ dependencies:
279
318
  - !ruby/object:Gem::Dependency
280
319
  name: fanforce-app-worker
281
320
  requirement: !ruby/object:Gem::Requirement
321
+ none: false
282
322
  requirements:
283
323
  - - ~>
284
324
  - !ruby/object:Gem::Version
@@ -286,6 +326,7 @@ dependencies:
286
326
  type: :runtime
287
327
  prerelease: false
288
328
  version_requirements: !ruby/object:Gem::Requirement
329
+ none: false
289
330
  requirements:
290
331
  - - ~>
291
332
  - !ruby/object:Gem::Version
@@ -451,6 +492,7 @@ files:
451
492
  - lib/fanforce/app_factory/sinatra/helper_routes/com_identifier.rb
452
493
  - lib/fanforce/app_factory/sinatra/helper_routes/com_js_widget.rb
453
494
  - lib/fanforce/app_factory/sinatra/helpers/assets.rb
495
+ - lib/fanforce/app_factory/sinatra/helpers/css_frameworks.rb
454
496
  - lib/fanforce/app_factory/sinatra/helpers/fanforce.rb
455
497
  - lib/fanforce/app_factory/sinatra/helpers/json.rb
456
498
  - lib/fanforce/app_factory/sinatra/helpers/ractive.rb
@@ -459,26 +501,27 @@ files:
459
501
  - lib/fanforce/app_factory/version.rb
460
502
  homepage: http://github.com/fanforce/gem-fanforce-app-factory
461
503
  licenses: []
462
- metadata: {}
463
504
  post_install_message:
464
505
  rdoc_options: []
465
506
  require_paths:
466
507
  - lib
467
508
  required_ruby_version: !ruby/object:Gem::Requirement
509
+ none: false
468
510
  requirements:
469
- - - '>='
511
+ - - ! '>='
470
512
  - !ruby/object:Gem::Version
471
513
  version: '0'
472
514
  required_rubygems_version: !ruby/object:Gem::Requirement
515
+ none: false
473
516
  requirements:
474
- - - '>'
517
+ - - ! '>'
475
518
  - !ruby/object:Gem::Version
476
519
  version: 1.3.1
477
520
  requirements: []
478
521
  rubyforge_project:
479
- rubygems_version: 2.0.14
522
+ rubygems_version: 1.8.23
480
523
  signing_key:
481
- specification_version: 4
524
+ specification_version: 3
482
525
  summary: Everything needed to setup a new app on Fanforce
483
526
  test_files: []
484
527
  has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 55a4e92da17e8eaed1471c55e2bc0253d6493832
4
- data.tar.gz: 34ba957668236bf3d5096a318f16160d111844ea
5
- SHA512:
6
- metadata.gz: 9639c5b2bcec3ecc4a288c9e8d4c462230734152a453265f84736384f8fa6042fa0c5649cb7c1edc161922775a64bbe1859dd667a8332bd05b3064268a2c11fe
7
- data.tar.gz: 88c03fcb2ab00c5509ebafb50569440060a58949bf400cc5717ac0e6f47f57e408c045ab9df5476fbf6bb197feebb5720d0ed87fafec0cfc376d40a90fab2b17