front_end_builds 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,6 @@
18
18
  <%= stylesheet_link_tag "front_end_builds/vendor.css" %>
19
19
  <%= stylesheet_link_tag "front_end_builds/admin.css" %>
20
20
  </head>
21
-
22
21
  <body></body>
23
22
 
24
23
  <%= javascript_include_tag "front_end_builds/vendor.js" %>
data/config/routes.rb CHANGED
@@ -1,12 +1,18 @@
1
- # Front end
1
+ # This is for the admin area.
2
2
  FrontEndBuilds::Engine.routes.draw do
3
- resources :apps, only: [:index, :show, :create, :edit, :destroy], path: '/api/apps'
3
+ scope :api do
4
+ resources :apps, only: [:index, :show, :create, :edit, :destroy]
5
+ resources :builds, only: [:index, :show, :edit]
6
+ resources :host_apps, only: [:show]
7
+ end
4
8
 
5
9
  get '/(*path)', to: 'admin#index'
6
10
  end
7
11
 
12
+ # This is for the posting of new apps.
8
13
  Rails.application.routes.draw do
9
14
  namespace :front_end_builds do
10
- resources :builds, only: [:index, :create]
15
+ resources :builds, only: [:create]
16
+ resource :best, only: [:show]
11
17
  end
12
18
  end
@@ -0,0 +1,8 @@
1
+ class RequireManualActivation < ActiveRecord::Migration
2
+ def change
3
+ add_column :front_end_builds_apps,
4
+ :require_manual_activation,
5
+ :boolean,
6
+ default: false
7
+ end
8
+ end
@@ -9,18 +9,13 @@ module FrontEndBuilds
9
9
  g.helper false
10
10
  end
11
11
 
12
- # Initializer to combine this engines static assets with the static assets of the hosting site.
13
- #initializer "static assets" do |app|
14
- #app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public")
15
- #end
16
-
17
- #initializer "front_end_assets.assets.precompile", group: :all do |app|
18
- #app.config.assets.precompile += %w(
19
- #front_end_builds/vendor.css
20
- #front_end_builds/admin.css
21
- #front_end_builds/vendor.js
22
- #front_end_builds/admin.js
23
- #)
24
- #end
12
+ initializer "front_end_assets.assets.precompile", group: :all do |app|
13
+ app.config.assets.precompile += %w(
14
+ front_end_builds/vendor.css
15
+ front_end_builds/admin.css
16
+ front_end_builds/vendor.js
17
+ front_end_builds/admin.js
18
+ )
19
+ end
25
20
  end
26
21
  end
@@ -5,6 +5,11 @@ module ActionDispatch::Routing
5
5
 
6
6
  # Create a front end in your rails router.
7
7
  def front_end(name, path = name, options = {})
8
+ defaults = {
9
+ branch: 'master',
10
+ app_name: name
11
+ }.merge(options)
12
+
8
13
  # Create a new build for this app.
9
14
  post(
10
15
  "#{path}" => "front_end_builds/builds#create",
@@ -16,13 +21,21 @@ module ActionDispatch::Routing
16
21
  # Get a build for this app.
17
22
  constraints FrontEndBuilds::HtmlRoutingConstraint.new do
18
23
  get(
19
- "/#{path}/(*path)" => "front_end_builds/builds#index",
20
- defaults: {
21
- branch: 'master',
22
- app_name: name
23
- }.merge(options)
24
+ "/#{path}/(*path)" => "front_end_builds/bests#show",
25
+ defaults: defaults
24
26
  )
27
+
28
+ # Need a better way to do this
29
+ front_end_route = Rails.application.routes.routes.routes.find do |route|
30
+ route.defaults == defaults.merge(
31
+ controller: "front_end_builds/bests",
32
+ action: "show"
33
+ )
34
+ end
35
+
36
+ FrontEndBuilds::App.register_url(name, front_end_route.format({}))
25
37
  end
38
+
26
39
  end
27
40
 
28
41
  end
@@ -1,3 +1,3 @@
1
1
  module FrontEndBuilds
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: front_end_builds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Toronto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-08 00:00:00.000000000 Z
12
+ date: 2015-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
@@ -133,7 +133,9 @@ files:
133
133
  - app/controllers/front_end_builds/admin_controller.rb
134
134
  - app/controllers/front_end_builds/application_controller.rb
135
135
  - app/controllers/front_end_builds/apps_controller.rb
136
+ - app/controllers/front_end_builds/bests_controller.rb
136
137
  - app/controllers/front_end_builds/builds_controller.rb
138
+ - app/controllers/front_end_builds/host_apps_controller.rb
137
139
  - app/helpers/front_end_builds/application_helper.rb
138
140
  - app/models/front_end_builds/app.rb
139
141
  - app/models/front_end_builds/build.rb
@@ -142,6 +144,7 @@ files:
142
144
  - db/migrate/20141010162405_create_front_end_builds_builds.rb
143
145
  - db/migrate/20141010165726_create_front_end_builds_apps.rb
144
146
  - db/migrate/20141105222855_add_endpoint_to_front_end_builds_build.rb
147
+ - db/migrate/20150114202950_require_manual_activation.rb
145
148
  - lib/front_end_builds.rb
146
149
  - lib/front_end_builds/engine.rb
147
150
  - lib/front_end_builds/ext/routes.rb