embargo 0.1.5 → 0.2.5

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: e6fe305bc963bb3d8c06ca14cc26d86714f4cd00
4
- data.tar.gz: 576e202902a2eba26e45442df8d5c5c0c55fa23e
3
+ metadata.gz: 54222070b2811497cacc7a3971671ddea9dd09f5
4
+ data.tar.gz: 0ed331cf8426646e967768374b62d50fca5249d9
5
5
  SHA512:
6
- metadata.gz: 06f4a15ec3b2acef5a2991b712420b5f8dd10c8b38f3266485847d814c8719870d2177ebfe0d812edb1ddc677b4afe34cafc3fb99c8350fa86a63a4c8db5837b
7
- data.tar.gz: 19770197e89acc90f134f385551a64487ef53367027d02c3691671ff2b69be530c25cc7b2e6aec58e642f3315e13e5d623094c07888c18cabe671983bd29fd58
6
+ metadata.gz: 57e93668aa4e2d440d5cccca750d86bf67dc583f8cf90b4baee49af2ac0f3e1972c89ca3d3c6135d638c0a6dc51cf8017d138bd839d8ef6ec146e81d811256cb
7
+ data.tar.gz: bea9cf9de0781ea4d3ef88a2b4913830263e6b0e49b0dc3098d31d2219fc399a454e4a70e76c0fe81911673a5a0ab215d28574411ef014fd8b109170f073cf01
@@ -3,5 +3,8 @@ Cuba.define do
3
3
  on root do
4
4
  res.write(MyModel.find.my_item)
5
5
  end
6
+ on "home" do
7
+ render "index", body_class: "page-index", page: "index"
8
+ end
6
9
  end
7
10
  end
@@ -1,5 +1,7 @@
1
+ require 'ostruct'
2
+
1
3
  class MyModel
2
- def find
3
- {my_item: "is here"}
4
+ def self.find
5
+ OpenStruct.new(my_item: "Hello world!")
4
6
  end
5
7
  end
@@ -0,0 +1,13 @@
1
+ Pages.define do
2
+ on get do
3
+ on root do
4
+ res.write(MyModel.find.my_item)
5
+ end
6
+ on "home" do
7
+ render "index", body_class: "page-index", page: "index"
8
+ end
9
+ end
10
+ on "api" do
11
+ run Api
12
+ end
13
+ end
@@ -1,9 +1,2 @@
1
- !!! 5
2
- %html(lang="en")
3
- %head
4
- %meta(charset="utf-8")
5
- %meta(http-equiv="X-UA-Compatible" content="IE=edge")
6
- %title Traitify, Life With Personality
7
- %body.page-index
8
-
9
- = partial("partials/_footer")
1
+ - content_for :title do
2
+ %title "The Title"
@@ -1,14 +0,0 @@
1
- %header.header(role="banner")
2
- .wrapper
3
- .row
4
- .header__icon
5
- %div
6
- %svg(version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" preserveAspectRatio="none")
7
- %circle(cx="8" cy="8" r="6.24" transform="rotate(90 8 8)")
8
-
9
- %nav.header__nav
10
- %ul
11
- %li
12
- %a(href="#page" title="How It Works") how it works?
13
- %li
14
- %a(href="mailto:support@yoursite.com" title="Contact") contact
data/lib/embargo.rb CHANGED
@@ -12,9 +12,8 @@ Cuba.plugin(Cuba::Render)
12
12
 
13
13
  class Embargo
14
14
  def self.application
15
- Cuba
15
+ Pages
16
16
  end
17
-
18
17
  def self.app_directory
19
18
  @@magis_working_directory ||= Dir.pwd
20
19
  end
@@ -27,15 +26,27 @@ class Embargo
27
26
  project_file_name = Embargo.app_directory + "/" + file_name
28
27
  project_file_exists = File.exist?(project_file_name)
29
28
 
30
- magis_file_name = Embargo.directory + "/" + file_name
31
- magis_file_exists = File.exist?(magis_file_name)
32
-
33
- if project_file_exists
34
- require home_file_name
35
- elsif magis_file_exists
36
- require magis_file_name
37
- end
29
+ if project_file_exists
30
+ require project_file_name
31
+ else
32
+ embargo_file_name = Embargo.directory + "/" + file_name
33
+ embargo_file_exists = File.exist?(embargo_file_name)
34
+ if embargo_file_exists
35
+ require embargo_file_name
36
+ end
37
+ end
38
38
  end
39
+
40
+ def self.action(&block)
41
+ @@actions ||= Array.new
42
+ @@actions.push(block)
43
+ end
44
+ def self.actions
45
+ $actions ||= @@actions
46
+ end
47
+ def self.first_load?
48
+ !$actions
49
+ end
39
50
  end
40
51
 
41
52
  #################
@@ -84,10 +95,16 @@ class Symbol
84
95
  end
85
96
  end
86
97
 
98
+ class Api < Cuba; end
99
+ class Pages < Cuba; end
100
+
87
101
  #################
88
102
  # Project Files
89
103
  #################
90
104
  Dir[Embargo.app_directory+"/lib/*.rb"].each {|file| require file }
91
105
  Dir[Embargo.app_directory+"/config/initializers/*.rb"].each {|file| require file }
92
106
  Dir[Embargo.app_directory+"/app/models/*.rb"].each {|file| require file }
93
- Dir[Embargo.app_directory+"/app/controllers/*_controller.rb"].each {|file| require file }
107
+ Dir[Embargo.app_directory+"/app/serializers/*.rb"].each {|file| require file }
108
+ Embargo.require_file("app/pages_controller.rb")
109
+ Embargo.require_file("app/api_controller.rb")
110
+ Embargo.require_file("app/pages_controller.rb")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embargo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Fleming
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-12-17 00:00:00.000000000 Z
13
+ date: 2014-12-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cuba
@@ -124,6 +124,20 @@ dependencies:
124
124
  - - '='
125
125
  - !ruby/object:Gem::Version
126
126
  version: 0.10.1
127
+ - !ruby/object:Gem::Dependency
128
+ name: rack-test
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - '='
132
+ - !ruby/object:Gem::Version
133
+ version: 0.10.1
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - '='
139
+ - !ruby/object:Gem::Version
140
+ version: 0.10.1
127
141
  - !ruby/object:Gem::Dependency
128
142
  name: rb-fsevent
129
143
  requirement: !ruby/object:Gem::Requirement
@@ -198,6 +212,7 @@ files:
198
212
  - boilerplate/project/Procfile
199
213
  - boilerplate/project/Procfile.prod
200
214
  - boilerplate/project/README.md
215
+ - boilerplate/project/app/api_controller.rb
201
216
  - boilerplate/project/app/assets/gulpfile.js
202
217
  - boilerplate/project/app/assets/package.json
203
218
  - boilerplate/project/app/assets/src/apple-touch-icon-precomposed.png
@@ -205,8 +220,8 @@ files:
205
220
  - boilerplate/project/app/assets/src/favicon.ico
206
221
  - boilerplate/project/app/assets/src/humans.txt
207
222
  - boilerplate/project/app/assets/src/robots.txt
208
- - boilerplate/project/app/controllers/home_controller.rb
209
223
  - boilerplate/project/app/models/my_model.rb
224
+ - boilerplate/project/app/pages_controller.rb
210
225
  - boilerplate/project/app/views/index.haml
211
226
  - boilerplate/project/app/views/layout.haml
212
227
  - boilerplate/project/app/views/partials/_footer.haml