maglove 2.0.4 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/{vendor → assets}/autoprefixer.js +0 -0
  3. data/{data/maglove → assets}/export.haml +0 -0
  4. data/{data/maglove → assets}/hpub/index.css +0 -0
  5. data/{data/maglove → assets}/hpub/index.haml +0 -0
  6. data/{data/maglove → assets}/hpub/page.haml +0 -0
  7. data/{data/maglove → assets}/index.haml +0 -0
  8. data/{data/maglove → assets}/maglove.css +0 -0
  9. data/{data/maglove → assets}/maglove.haml +0 -0
  10. data/{data/maglove → assets}/maglove.js +1 -1
  11. data/{data/maglove → assets}/scaffold/base/base.coffee +0 -0
  12. data/{data/maglove → assets}/scaffold/base/base.less +0 -0
  13. data/{data/maglove → assets}/scaffold/base/images/base/loading-bars.svg +0 -0
  14. data/{data/maglove → assets}/scaffold/base/less/base/animations.less +0 -0
  15. data/{data/maglove → assets}/scaffold/base/less/base/blockquotes.less +0 -0
  16. data/{data/maglove → assets}/scaffold/base/less/base/buttons.less +0 -0
  17. data/{data/maglove → assets}/scaffold/base/less/base/code.less +0 -0
  18. data/{data/maglove → assets}/scaffold/base/less/base/forms.less +0 -0
  19. data/{data/maglove → assets}/scaffold/base/less/base/global.less +0 -0
  20. data/{data/maglove → assets}/scaffold/base/less/base/grid-minimal.less +0 -0
  21. data/{data/maglove → assets}/scaffold/base/less/base/grid-non-responsive.less +0 -0
  22. data/{data/maglove → assets}/scaffold/base/less/base/grid.less +0 -0
  23. data/{data/maglove → assets}/scaffold/base/less/base/helpers.less +0 -0
  24. data/{data/maglove → assets}/scaffold/base/less/base/images.less +0 -0
  25. data/{data/maglove → assets}/scaffold/base/less/base/lists.less +0 -0
  26. data/{data/maglove → assets}/scaffold/base/less/base/mixins.less +0 -0
  27. data/{data/maglove → assets}/scaffold/base/less/base/print.less +0 -0
  28. data/{data/maglove → assets}/scaffold/base/less/base/resets.less +0 -0
  29. data/{data/maglove → assets}/scaffold/base/less/base/tables.less +0 -0
  30. data/{data/maglove → assets}/scaffold/base/less/core/alignments.less +0 -0
  31. data/{data/maglove → assets}/scaffold/base/less/core/cleanup.less +0 -0
  32. data/{data/maglove → assets}/scaffold/base/less/core/editor.less +0 -0
  33. data/{data/maglove → assets}/scaffold/base/less/core/typography.less +0 -0
  34. data/{data/maglove → assets}/scaffold/base/less/vendor/flex-video.less +0 -0
  35. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome.less +0 -0
  36. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/animated.less +0 -0
  37. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/bordered-pulled.less +0 -0
  38. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/core.less +0 -0
  39. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/fixed-width.less +0 -0
  40. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/font-awesome.less +0 -0
  41. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/icons.less +0 -0
  42. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/larger.less +0 -0
  43. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/list.less +0 -0
  44. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/mixins.less +0 -0
  45. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/rotated-flipped.less +0 -0
  46. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/stacked.less +0 -0
  47. data/{data/maglove → assets}/scaffold/base/less/vendor/font-awesome/variables.less +0 -0
  48. data/{data/maglove → assets}/scaffold/base/less/vendor/image-loader.less +0 -0
  49. data/{data/maglove → assets}/scaffold/base/less/vendor/magnific-popup.less +0 -0
  50. data/{data/maglove → assets}/scaffold/base/less/widgets/banner.less +0 -0
  51. data/{data/maglove → assets}/scaffold/base/less/widgets/button.less +0 -0
  52. data/{data/maglove → assets}/scaffold/base/less/widgets/callout.less +0 -0
  53. data/{data/maglove → assets}/scaffold/base/less/widgets/columns.less +0 -0
  54. data/{data/maglove → assets}/scaffold/base/less/widgets/container.less +0 -0
  55. data/{data/maglove → assets}/scaffold/base/less/widgets/feedback.less +0 -0
  56. data/{data/maglove → assets}/scaffold/base/less/widgets/heading.less +0 -0
  57. data/{data/maglove → assets}/scaffold/base/less/widgets/horizontal_rule.less +0 -0
  58. data/{data/maglove → assets}/scaffold/base/less/widgets/image.less +0 -0
  59. data/{data/maglove → assets}/scaffold/base/less/widgets/paragraph.less +0 -0
  60. data/{data/maglove → assets}/scaffold/base/variables.less +0 -0
  61. data/{data/maglove → assets}/scaffold/base/vendor/jquery.js +0 -0
  62. data/{data/maglove → assets}/scaffold/theme/images/logo.png +0 -0
  63. data/{data/maglove → assets}/scaffold/theme/images/pattern/symphony.png +0 -0
  64. data/{data/maglove → assets}/scaffold/theme/less/base/variables.less +0 -0
  65. data/{data/maglove → assets}/scaffold/theme/templates/article-01.haml +3 -3
  66. data/{data/maglove → assets}/scaffold/theme/templates/cover.haml +0 -0
  67. data/{data/maglove → assets}/scaffold/theme/templates/toc.haml +1 -1
  68. data/{data/maglove → assets}/scaffold/theme/templates/toc.yml +0 -0
  69. data/{data/maglove → assets}/scaffold/theme/theme.coffee +0 -0
  70. data/{data/maglove → assets}/scaffold/theme/theme.less +0 -0
  71. data/{data/maglove → assets}/thumbnail.haml +0 -0
  72. data/{data/maglove → assets}/thumbnail.js +0 -0
  73. data/bin/maglove +0 -6
  74. data/lib/magloft/api_caller.rb +12 -12
  75. data/lib/magloft/remote_resource.rb +17 -17
  76. data/lib/maglove.rb +19 -19
  77. data/lib/maglove/asset/theme.rb +7 -6
  78. data/lib/maglove/commands/assets.rb +61 -44
  79. data/lib/maglove/commands/base.rb +5 -1
  80. data/lib/maglove/commands/fonts.rb +9 -6
  81. data/lib/maglove/commands/main.rb +3 -1
  82. data/lib/maglove/commands/theme.rb +63 -58
  83. data/lib/maglove/middleware/live_reload.rb +19 -11
  84. data/lib/maglove/server.rb +18 -8
  85. data/lib/maglove/theme.rb +27 -0
  86. data/lib/maglove/tilt/coffee_template.rb +1 -1
  87. data/lib/maglove/tilt/haml_template.rb +2 -3
  88. data/lib/maglove/tilt/js_template.rb +1 -2
  89. data/lib/maglove/tilt/scss_template.rb +3 -9
  90. data/lib/maglove/tilt/yaml_template.rb +2 -3
  91. data/lib/maglove/version.rb +1 -1
  92. data/lib/powersnap.rb +1 -3
  93. metadata +164 -155
  94. data/.gitignore +0 -9
  95. data/.rubocop.yml +0 -157
  96. data/Gemfile +0 -3
  97. data/Gemfile.lock +0 -206
  98. data/README.md +0 -26
  99. data/lib/block_resolver.rb +0 -6
  100. data/lib/maglove/application.rb +0 -58
  101. data/lib/maglove/phantom_script.rb +0 -44
  102. data/lib/maglove/workspace.rb +0 -41
  103. data/lib/workspace.rb +0 -11
  104. data/lib/workspace/workspace_dir.rb +0 -98
  105. data/lib/workspace/workspace_dir/archive.rb +0 -18
  106. data/lib/workspace/workspace_file.rb +0 -127
  107. data/lib/workspace/workspace_file/archive.rb +0 -45
  108. data/lib/workspace/workspace_file/media.rb +0 -19
  109. data/lib/workspace/workspace_file/net.rb +0 -18
  110. data/lib/workspace/workspace_file/parse.rb +0 -21
  111. data/maglove.gemspec +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65e479f768c7700d2bbc986b901fbdc3818a6b08
4
- data.tar.gz: 85dc7407efcc70f10ad67b73b2c147328360e60a
3
+ metadata.gz: 7f7896a05f75ab83d370e8ee2e04751f7a534079
4
+ data.tar.gz: bd7fab9800b1a8da0e8e31bddc167d3bfe447b5f
5
5
  SHA512:
6
- metadata.gz: 503990999cd27820790637bc3885729708e57975e011bb050ad050e0c1e419fb0b4e6b1d46aa5e8ceb59310aeb91f87b9978d1887ddb1eda576f410f8627f683
7
- data.tar.gz: 253eee85575e1667789e1d950ce4ffc2d32c65b5943d054eb23c7fa0cc269789f093f9990d17a4d41b56a9bd2d359e8e82cf86131bc1313594861536579fb920
6
+ metadata.gz: 8813bda699c274fb6bcdd43752f4f2633ebced987cc6070f051aeeba190ecb09b19d11702364dc699ebfdefa61217d89d8ec6c5ce88e1463d10719d3b5825c22
7
+ data.tar.gz: 11e012d299e08125c3f4c3144463cd3fb5a41b02fafeb42527f5a71aad3cfd47901a6ef8b1b3757440f6b0070b6f5b70271a3c7fb5165a3119c8bbfe1bb4f246
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -37,7 +37,7 @@ class MagLove {
37
37
  init(message) {
38
38
  console.log("MagLove Initialized")
39
39
  this.templates = message.templates
40
- this.send("watch")
40
+ this.send("watch", { template: this.template })
41
41
  if(window.ThemeApi) {
42
42
  window.ThemeApi.init({deviceId: 'AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE', appId: 'com.magloft.maglove', apiHost: 'www.magloft.com'})
43
43
  }
File without changes
File without changes
@@ -2,7 +2,7 @@
2
2
  - drop_container
3
3
 
4
4
  -# ROOT CONTAINER
5
- - container_widget animate: "scale-background", min_height: "calc(100vh - 92px)", parallax_effect: "fixed", image_source: variable(:background_url, asset("images/sample/skyscraper.jpg")), image_size: "cover", background_color: "overlay", image_position: "center center" do
5
+ - container_widget animate: "scale-background", min_height: "calc(100vh - 92px)", parallax_effect: "fixed", image_source: var(:background_url, asset("images/sample/skyscraper.jpg")), image_size: "cover", background_color: "overlay", image_position: "center center" do
6
6
 
7
7
  -# TOP PAGE CONTAINER
8
8
  - container_widget min_height: "calc(100vh - 92px)" do
@@ -13,7 +13,7 @@
13
13
  -# MAIN HEADING
14
14
  - heading_widget align: "left", style: "feature" do
15
15
  - style :bold, color: "#FFFFFF" do
16
- = variable(:title, "Article Title")
16
+ = var(:title, "Article Title")
17
17
 
18
18
  - horizontal_rule_widget style: "flourish-01", color: "light"
19
19
 
@@ -30,7 +30,7 @@
30
30
  - container_widget parallax_effect: "up", image_source: asset("images/base/bg/stripes.jpg"), margin_left: "20px", margin_right: "20px", margin_top: "20px", padding_top: "2em", padding_bottom: "2em", padding_left: "2em", padding_right: "2em" do
31
31
  - heading_widget type: "h2", align: "center", style: "feature" do
32
32
  - style :bold, color: "#FFFFFF" do
33
- = variable(:title, "WHY I DESIGN?")
33
+ = var(:title, "WHY I DESIGN?")
34
34
 
35
35
  -# BODY CONTAINER
36
36
  - container_widget padding_top: "2em", padding_left: "0em", padding_right: "0em" do
@@ -2,7 +2,7 @@
2
2
  - drop_container
3
3
 
4
4
  -# ROOT CONTAINER
5
- - container_widget min_height: "100vh", parallax_effect: "fixed", image_source: variable(:background_url, asset("images/bg/toc.jpg")), image_size: "cover", image_position: "top center", padding_left: "20px", padding_right: "20px" do
5
+ - container_widget min_height: "100vh", parallax_effect: "fixed", image_source: var(:background_url, asset("images/bg/toc.jpg")), image_size: "cover", image_position: "top center", padding_left: "20px", padding_right: "20px" do
6
6
 
7
7
  -# FIXED CONTAINER
8
8
  - container_widget animate: "fade-in-up scroll-animate", padding_top: "2em", padding_left: "20px", padding_right: "20px" do
File without changes
File without changes
File without changes
data/bin/maglove CHANGED
@@ -4,14 +4,8 @@ require "thor"
4
4
  require "ext/thor/option"
5
5
  require 'coffee_script'
6
6
  require "active_support/all"
7
- require "hamloft"
8
- require "workspace"
9
7
  require "typhoeus"
10
8
  require "maglove"
11
- require "action_dispatch/http/mime_type"
12
-
13
- # require local widgets
14
- Dir["widgets/*.rb"].each { |path| require File.join(Dir.pwd, path) }
15
9
 
16
10
  # allow colons
17
11
  ARGV.unshift(*ARGV.shift.split(":")) if ARGV.count > 0 and ARGV[0].include?(":")
@@ -43,33 +43,33 @@ module MagLoft
43
43
  end
44
44
 
45
45
  short_circuits.add(
46
- if: -> (response) { Dialers::Status.new(response.status).server_error? },
47
- do: -> (response) { fail Dialers::ServerError, response }
46
+ if: ->(response) { Dialers::Status.new(response.status).server_error? },
47
+ do: ->(response) { fail Dialers::ServerError, response }
48
48
  )
49
49
 
50
50
  short_circuits.add(
51
- if: -> (response) { Dialers::Status.new(response.status).is?(404) },
52
- do: -> (response) { fail Dialers::NotFoundError, response }
51
+ if: ->(response) { Dialers::Status.new(response.status).is?(404) },
52
+ do: ->(response) { fail Dialers::NotFoundError, response }
53
53
  )
54
54
 
55
55
  short_circuits.add(
56
- if: -> (response) { Dialers::Status.new(response.status).is?(409) },
57
- do: -> (response) { fail ConflictError, response }
56
+ if: ->(response) { Dialers::Status.new(response.status).is?(409) },
57
+ do: ->(response) { fail ConflictError, response }
58
58
  )
59
59
 
60
60
  short_circuits.add(
61
- if: -> (response) { Dialers::Status.new(response.status).is?(400) },
62
- do: -> (response) { fail ValidationError, response }
61
+ if: ->(response) { Dialers::Status.new(response.status).is?(400) },
62
+ do: ->(response) { fail ValidationError, response }
63
63
  )
64
64
 
65
65
  short_circuits.add(
66
- if: -> (response) { Dialers::Status.new(response.status).is?(422) },
67
- do: -> (response) { fail ValidationError, response }
66
+ if: ->(response) { Dialers::Status.new(response.status).is?(422) },
67
+ do: ->(response) { fail ValidationError, response }
68
68
  )
69
69
 
70
70
  short_circuits.add(
71
- if: -> (response) { Dialers::Status.new(response.status).is?(401) },
72
- do: -> (response) { fail UnauthorizedError, response }
71
+ if: ->(response) { Dialers::Status.new(response.status).is?(401) },
72
+ do: ->(response) { fail UnauthorizedError, response }
73
73
  )
74
74
 
75
75
  class ConflictError < Dialers::ErrorWithResponse
@@ -1,6 +1,6 @@
1
1
  module MagLoft
2
2
  class RemoteResource
3
- attr_accessor :changed_data, :id
3
+ attr_accessor :id
4
4
  attr_reader :destroyed
5
5
 
6
6
  def initialize(attributes = {})
@@ -9,33 +9,33 @@ module MagLoft
9
9
  end
10
10
 
11
11
  def changed?
12
- self.changed_data.keys.count > 0
12
+ changed_data.keys.count > 0
13
13
  end
14
14
 
15
15
  def destroyed?
16
- self.destroyed == true
16
+ destroyed == true
17
17
  end
18
18
 
19
19
  def save
20
20
  return false if destroyed? or !changed?
21
- if self.changed_data.keys.count > 0
22
- if self.id.nil?
23
- transformable = Api.client.api_caller.post(self.class.endpoint, self.changed_data)
21
+ if changed_data.keys.count > 0
22
+ if id.nil?
23
+ transformable = Api.client.api_caller.post(self.class.endpoint, changed_data)
24
24
  else
25
- transformable = Api.client.api_caller.put("#{self.class.endpoint}/#{self.id}", self.changed_data.except(:id))
25
+ transformable = Api.client.api_caller.put("#{self.class.endpoint}/#{id}", changed_data.except(:id))
26
26
  end
27
27
  transformable.transform_to_existing(self)
28
- self.clear_changed_data!
28
+ clear_changed_data!
29
29
  end
30
30
  self
31
31
  end
32
32
 
33
33
  def destroy
34
- return false if self.id.nil? or self.destroyed?
35
- transformable = Api.client.api_caller.delete("#{self.class.endpoint}/#{self.id}")
34
+ return false if id.nil? or destroyed?
35
+ transformable = Api.client.api_caller.delete("#{self.class.endpoint}/#{id}")
36
36
  transformable.transform_to_existing(self)
37
37
  @destroyed = true
38
- self.clear_changed_data!
38
+ clear_changed_data!
39
39
  self
40
40
  end
41
41
 
@@ -44,12 +44,12 @@ module MagLoft
44
44
  end
45
45
 
46
46
  def clear_changed_data!
47
- self.changed_data = {}
47
+ @changed_data = {}
48
48
  self
49
49
  end
50
50
 
51
51
  def update_data(key, value)
52
- if self.send(key) != value
52
+ if send(key) != value
53
53
  instance_variable_set("@#{key}", value)
54
54
  changed_data[key] = value
55
55
  end
@@ -63,8 +63,8 @@ module MagLoft
63
63
  def remote_attribute(*args)
64
64
  args.each do |arg|
65
65
  remote_attributes.push(arg)
66
- self.class_eval("attr_accessor :#{arg}")
67
- self.class_eval("def #{arg}=(val);update_data(:#{arg}, val);end")
66
+ class_eval("attr_accessor :#{arg}", __FILE__, __LINE__)
67
+ class_eval("def #{arg}=(val);update_data(:#{arg}, val);end", __FILE__, __LINE__)
68
68
  end
69
69
  end
70
70
 
@@ -93,7 +93,7 @@ module MagLoft
93
93
  end
94
94
 
95
95
  def create(attributes = {})
96
- entity = self.new(attributes)
96
+ entity = new(attributes)
97
97
  entity.save
98
98
  entity
99
99
  end
@@ -104,7 +104,7 @@ module MagLoft
104
104
  if remote_attributes.include?(attribute)
105
105
  params = {}
106
106
  params[attribute] = args.first
107
- return self.find_one(params)
107
+ return find_one(params)
108
108
  end
109
109
  end
110
110
  super
data/lib/maglove.rb CHANGED
@@ -1,35 +1,35 @@
1
1
  require 'magloft'
2
- require "maglove/workspace"
3
- require "maglove/widgets"
2
+ require "workspace"
3
+ require "workspace-parse"
4
+ require "maglove/theme"
5
+ require "maglove/engine"
4
6
  require "maglove/commands/base"
5
7
  require "maglove/commands/fonts"
6
8
  require "maglove/commands/theme"
7
9
  require "maglove/commands/assets"
8
10
  require "maglove/commands/main"
9
- require "block_resolver"
10
11
 
11
12
  module Maglove
12
- def self.theme_config(key = nil, theme)
13
- @theme_config ||= {}
14
- unless @theme_config[theme]
15
- config_file = Workspace::WorkspaceFile.new("src/themes/#{theme}", "theme.yml")
16
- @theme_config[theme] = config_file.read_yaml
17
- end
18
- if key.nil?
19
- @theme_config[theme]
20
- else
21
- @theme_config[theme][key.to_s]
13
+ def self.theme
14
+ Theme.instance
15
+ end
16
+
17
+ def self.assets_dir
18
+ @assets_dir ||= begin
19
+ spec = Gem::Specification.find_by_name("maglove")
20
+ Workspace::Dir.new(spec.gem_dir).dir("assets")
22
21
  end
23
22
  end
24
23
 
25
24
  def self.logger
26
25
  if @logger.nil?
27
- Logging.color_scheme("bright",
28
- levels: { debug: :blue, info: :green, warn: :yellow, error: :red, fatal: [:white, :on_red] },
29
- date: :blue,
30
- mdc: :cyan,
31
- logger: :cyan,
32
- message: :black)
26
+ Logging.color_scheme("bright", {
27
+ levels: { debug: :blue, info: :green, warn: :yellow, error: :red, fatal: [:white, :on_red] },
28
+ date: :blue,
29
+ mdc: :cyan,
30
+ logger: :cyan,
31
+ message: :black
32
+ })
33
33
  Logging.appenders.stdout("stdout", layout: Logging.layouts.pattern(pattern: '[%d] %-5l %-18X{full_command} %x %m\n', color_scheme: 'bright'))
34
34
  @logger = Logging::Logger.new(self.class.name)
35
35
  @logger.level = :debug
@@ -11,7 +11,6 @@ require "maglove/tilt/yaml_template"
11
11
  module MagLove
12
12
  module Asset
13
13
  class Theme
14
- include Workspace
15
14
  include MagLove::Helper::LogHelper
16
15
  attr_reader :mtime, :path, :valid, :contents, :options
17
16
 
@@ -20,22 +19,24 @@ module MagLove
20
19
  "less" => "css",
21
20
  "scss" => "css",
22
21
  "coffee" => "js",
22
+ "js" => "js",
23
23
  "yml" => "json"
24
24
  }
25
25
 
26
26
  def initialize(path, options = {})
27
27
  @path = path
28
28
  @options = options
29
+ @options[:theme] = Maglove.theme.identifier
29
30
  @mtime = File.mtime(absolute_path)
30
31
  begin
31
32
  if ::Tilt[input_type]
32
33
  template = ::Tilt.new(absolute_path)
33
- @contents = template.render(Object.new, @options.merge(base_path: theme_base_dir.to_s))
34
+ @contents = template.render(Object.new, @options.merge(base_path: "src/base/#{Maglove.theme.base_version}/"))
34
35
  else
35
36
  @contents = File.read(absolute_path)
36
37
  end
37
- rescue StandardError => e
38
- error("▸ #{e.message}")
38
+ rescue Maglove::Engine::RenderError => e
39
+ error("▸ HAML error: #{e.message}")
39
40
  end
40
41
  end
41
42
 
@@ -68,9 +69,9 @@ module MagLove
68
69
 
69
70
  def absolute_path
70
71
  if @options[:base]
71
- File.absolute_path("src/base/#{theme_config(:base_version)}/#{path}")
72
+ Maglove.theme.base_dir.file(path).absolute_path
72
73
  else
73
- File.absolute_path("src/themes/#{@options[:theme]}/#{path}")
74
+ Maglove.theme.src_dir.file(path).absolute_path
74
75
  end
75
76
  end
76
77