maglove 0.3.0 → 0.5.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
2
  SHA1:
3
- metadata.gz: e160cf98468a05b0041ce4b15fdc1c1e37f85248
4
- data.tar.gz: e671b2b2e955e1391a3ea9648d00add15cdf0260
3
+ metadata.gz: a8cd0e5c5c46effb5323d591b0cb6e4b36fdfc14
4
+ data.tar.gz: 2def09d4d5e5497f1c98ad43ed16ee8fe8b96669
5
5
  SHA512:
6
- metadata.gz: fcde4b2f7a72c0b2c8d9f09df21eb991a524dfc2ffff290005bae12a0b47a442c447fa4ed6c0c5f9cce78f40fc4af2a8b53fa2c881a102a9b5d96487bc69a8c5
7
- data.tar.gz: 18aa73365dad5bc47adcb7d48f79a0f3b12ecc235d27d77ba2e592e5c28da5aff7f1a3f24dfd9e41d83e489d2632c9530f519234042920b149eb651863b30fcd
6
+ metadata.gz: a6c36229e97a9b1c628c3afe4a8d33f442606979911e20855bf0a12c0a459984457dc30c8880013d0d93cf87396fd1f803972d9a13b083ec828f1c8821769c80
7
+ data.tar.gz: 23cddea15c6c11b3653f9652ba4d31d076da7ff59748a86b9a2f4f3fd5cf428d650a96193d50b5ea835151cdcc710907a361a459f573ef8569074f117623f669
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maglove (0.2.1)
4
+ maglove (0.4.0)
5
5
  activesupport (~> 4.2)
6
6
  bundler (~> 1.10)
7
7
  coffee-script (~> 2.4)
@@ -23,7 +23,7 @@ PATH
23
23
  GEM
24
24
  remote: https://rubygems.org/
25
25
  specs:
26
- activesupport (4.2.3)
26
+ activesupport (4.2.4)
27
27
  i18n (~> 0.7)
28
28
  json (~> 1.7, >= 1.7.7)
29
29
  minitest (~> 5.1)
@@ -49,9 +49,8 @@ GEM
49
49
  fspath (2.1.1)
50
50
  haml (4.0.7)
51
51
  tilt
52
- hamloft (0.1.1)
52
+ hamloft (0.1.3)
53
53
  activesupport (~> 4.2)
54
- bundler (~> 1.10)
55
54
  haml (~> 4.0)
56
55
  nokogiri (~> 1.6)
57
56
  highline (1.7.3)
@@ -71,7 +70,7 @@ GEM
71
70
  less (2.6.0)
72
71
  commonjs (~> 0.2.7)
73
72
  libv8 (3.16.14.11)
74
- little-plugger (1.1.3)
73
+ little-plugger (1.1.4)
75
74
  logging (2.0.0)
76
75
  little-plugger (~> 1.1)
77
76
  multi_json (~> 1.10)
@@ -134,4 +133,4 @@ DEPENDENCIES
134
133
  rubocop (~> 0.32)
135
134
 
136
135
  BUNDLED WITH
137
- 1.10.5
136
+ 1.10.6
@@ -0,0 +1,58 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %meta{ charset: "UTF-8" }
5
+ %title= "#{theme} - #{template}"
6
+ %meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" }
7
+ %link{ href: "themes/#{theme}/theme.css", media: "screen", rel: "stylesheet" }
8
+ %link{ href: "fonts/fonts.css", media: "screen", rel: "stylesheet" }
9
+ %script{ src: "themes/#{theme}/theme.js", type: "text/javascript" }
10
+ :css
11
+ div#__inspector {
12
+ position: fixed !important;
13
+ top: 8px !important;
14
+ right: 8px !important;
15
+ height: 32px !important;
16
+ background: #FFF !important;
17
+ line-height: 32px !important;
18
+ z-index: 1000000 !important;
19
+ text-transform: uppercase !important;
20
+ font-size: 11px !important;
21
+ font-weight: bold !important;
22
+ letter-spacing: 1px !important;
23
+ font-family: "Helvetica Neue" !important;
24
+ opacity: 0.25 !important;
25
+ transition: opacity 300ms !important;
26
+ }
27
+
28
+ div#__inspector:hover {
29
+ opacity: 1 !important;
30
+ }
31
+
32
+ div#__inspector a {
33
+ color: #171717 !important;
34
+ padding: 0px 12px !important;
35
+ border-left: 1px solid #F5F5F5 !important;
36
+ border-right: none !important;
37
+ border-top: none !important;
38
+ border-bottom: none !important;
39
+ display: inline-block !important;
40
+ float: left !important;
41
+ }
42
+
43
+ div#__inspector a:hover {
44
+ color: #FFFFFF !important;
45
+ background: #000000 !important;
46
+ }
47
+
48
+ div#__inspector a:first-child {
49
+ border-left: none !important;
50
+ }
51
+
52
+ %body
53
+ = contents
54
+ - if templates.count > 1
55
+ #__inspector
56
+ - templates.each do |template|
57
+ %a{href: "#{template}.html"}
58
+ = template
@@ -5,7 +5,7 @@ module Commander
5
5
  class Options
6
6
 
7
7
  def __merge(params)
8
- new_options = options.__clone
8
+ new_options = self.__clone
9
9
  new_options.__hash__.merge!(params)
10
10
  new_options
11
11
  end
@@ -13,7 +13,50 @@ module MagLove
13
13
  error!("▸ SYNC error: please specify a bucket to use (cdn.magloft.com, test-cdn.magloft.com)") if options.bucket == "localhost:3001"
14
14
  invoke_task("sync:cdn", options)
15
15
  end
16
+ end
17
+
18
+ task :deploy, theme: ENV["THEME"], out: ".", sync: "NO", bucket: "localhost:3002" do |args, options|
19
+
20
+ # Compile Theme
21
+ invoke_task("theme:compile", options)
16
22
 
23
+ # Prepare Deployment Directory
24
+ output_path = File.expand_path(options.out)
25
+ error!("Directory '#{output_path}' does not exist!") if !File.directory?(output_path)
26
+ target_path = File.join(output_path, options.theme)
27
+ FileUtils.rm_r(target_path) if File.directory?(target_path)
28
+ FileUtils.mkdir_p(File.join(target_path, "themes"))
29
+
30
+ # Copy Assets
31
+ FileUtils.cp_r(theme_dist_path(nil, options.theme), File.join(target_path, "themes/#{options.theme}"))
32
+ FileUtils.cp_r(File.join("dist", "fonts"), File.join(target_path, "fonts"))
33
+
34
+ # Process Templates
35
+ templates = theme_config(:templates, options.theme)
36
+ templates.each do |template|
37
+ debug "▸ processing template #{template}"
38
+
39
+ # Render template
40
+ variables_yaml = theme_contents("templates/#{template}.yml", options.theme)
41
+ variables = variables_yaml ? YAML.load(variables_yaml).with_indifferent_access : {}
42
+ variables[:theme] = options.theme
43
+ template_file = theme_glob("templates/#{template}.{html,twig,haml}", options.theme).first
44
+ if !template_file.nil?
45
+ asset = MagLove::Asset::Theme.new(template_file, options.theme, variables)
46
+ contents = asset.contents
47
+ else
48
+ contents = "<p style='text-align: center; margin-top: 12px;'>ERROR: Template '#{template}' not found!</p>"
49
+ end
50
+
51
+ # Render Static Dump
52
+ haml_contents = File.read(File.join(Gem.datadir("maglove"), "dump.haml"))
53
+ html_contents = Hamloft.render(haml_contents, theme: options.theme, contents: contents, templates: templates, template: template)
54
+
55
+ # Write to file
56
+ File.open(File.join(target_path, "#{template}.html"), "w") {|f| f.write(html_contents) }
57
+ end
58
+
59
+
17
60
  end
18
61
 
19
62
  task :"compile-all", sync: "NO", bucket: "localhost:3002" do |args, options|
@@ -79,7 +79,11 @@ module MagLove
79
79
  def watch_config(config, options)
80
80
  config.each do |task, pattern|
81
81
  watch(pattern) do |filename, event|
82
- invoke_task(task, options.__merge(pattern: filename))
82
+ begin
83
+ invoke_task(task, options.__merge(pattern: filename))
84
+ rescue Exception => e
85
+ error(e.message)
86
+ end
83
87
  end
84
88
  end
85
89
  end
@@ -1,3 +1,3 @@
1
1
  module MagLove
2
- VERSION = "0.3.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -303,6 +303,7 @@ files:
303
303
  - Gemfile.lock
304
304
  - README.md
305
305
  - bin/maglove
306
+ - data/maglove/dump.haml
306
307
  - data/maglove/scaffold/base/base.coffee
307
308
  - data/maglove/scaffold/base/base.less
308
309
  - data/maglove/scaffold/base/images/base/loading-bars.svg