comable_backend 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 112e6687fc80272ec60047664f31301bedf3d61a
4
+ data.tar.gz: 49f7e090078551b7b7fff4bc63741b6885a7b708
5
+ SHA512:
6
+ metadata.gz: e416bfbee70f488b0f1c4eccc653d9aa04af370b7d67fbe170587a8db9312a853565a92040bde1f622b51882935157c667ba10477d8643d3ce2e19d855d4c880
7
+ data.tar.gz: 7ec99a00299ca03f2dd364383a90b2b611b6e43f69f2538286d357dba7ff9a7d0247742e1380617be9224986af70018b5a1eb8c4dd8c013b89333e6f0d957cfd
@@ -0,0 +1,20 @@
1
+ Copyright 2014 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,84 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__)
10
+ require 'tasks/release'
11
+
12
+ RDoc::Task.new(:rdoc) do |rdoc|
13
+ rdoc.rdoc_dir = 'rdoc'
14
+ rdoc.title = 'Comable'
15
+ rdoc.options << '--line-numbers'
16
+ rdoc.rdoc_files.include('lib/**/*.rb')
17
+ end
18
+
19
+ if ENV['COMABLE_NESTED']
20
+ task default: ['app:spec', 'rubocop']
21
+ else
22
+ APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
23
+ load 'rails/tasks/engine.rake'
24
+
25
+ namespace :app do
26
+ namespace :spec do
27
+ desc 'Run the code examples'
28
+ RSpec::Core::RakeTask.new(:all) do |t|
29
+ FRAMEWORKS.each do |framework|
30
+ t.pattern << ",#{framework}/spec/**{,/*/**}/*_spec.rb"
31
+ end
32
+ end
33
+
34
+ FRAMEWORKS.each do |framework|
35
+ desc "Run the code examples in #{framework}/spec"
36
+ RSpec::Core::RakeTask.new(framework) do |t|
37
+ t.pattern = "../#{framework}/spec/**{,/*/**}/*_spec.rb"
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ namespace :db do
44
+ task 'migrate' => 'app:db:migrate'
45
+ task 'app:db:migrate' => 'migrate:all'
46
+
47
+ namespace :migrate do
48
+ task :all do
49
+ FRAMEWORKS.each do |framework|
50
+ command = "cd #{framework} && test -d db && bundle exec rake db:migrate RAILS_ENV=#{Rails.env} COMABLE_NESTED=true"
51
+ puts command
52
+ system command
53
+ end
54
+ end
55
+ end
56
+
57
+ namespace :migrate do
58
+ task 'reset' => 'app:db:migrate:reset'
59
+ task 'app:db:migrate:reset' => 'app:db:migrate'
60
+ task 'app:db:migrate' => 'reset:all'
61
+
62
+ namespace :reset do
63
+ task :all do
64
+ FRAMEWORKS.each do |framework|
65
+ command = "cd #{framework} && test -d db && bundle exec rake db:migrate:reset RAILS_ENV=#{Rails.env} COMABLE_NESTED=true"
66
+ puts command
67
+ system command
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+
74
+ task default: ['app:spec:all', 'rubocop']
75
+ end
76
+
77
+ Bundler::GemHelper.install_tasks
78
+
79
+ # from https://github.com/rspec/rspec-rails/issues/936
80
+ task 'test:prepare'
81
+
82
+ task :rubocop do
83
+ exec 'rubocop'
84
+ end
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,7 @@
1
+ module Comable
2
+ module Admin
3
+ class ApplicationController < ActionController::Base
4
+ layout 'comable/admin/application'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ require_dependency 'comable/admin/application_controller'
2
+
3
+ module Comable
4
+ module Admin
5
+ class ProductsController < ApplicationController
6
+ def index
7
+ @products = Comable::Product.all
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ module Comable
2
+ module Admin
3
+ module ApplicationHelper
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Comable
2
+ module Admin
3
+ module ProductsHelper
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ h1 Admin::Products#index
2
+
3
+ - if @products.any?
4
+ ul
5
+ - @products.each do |product|
6
+ li = product.name
@@ -0,0 +1,9 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title ComableBackend
5
+ = stylesheet_link_tag 'comable/admin/application', media: 'all'
6
+ = javascript_include_tag 'comable/admin/application'
7
+ = csrf_meta_tags
8
+ body
9
+ = yield
@@ -0,0 +1,5 @@
1
+ Comable::Core::Engine.routes.draw do
2
+ scope :admin do
3
+ get '/' => 'admin/products#index'
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ require 'comable_core'
2
+
3
+ require 'slim'
4
+
5
+ module Comable
6
+ module Backend
7
+ class Engine < ::Rails::Engine
8
+ # XXX: a code below to delegate comable:install:migrations to comable_core
9
+ config.paths['db/migrate'] = []
10
+ end
11
+ end
12
+ end
@@ -0,0 +1 @@
1
+ require 'comable/backend/engine'
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :comable_backend do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: comable_backend
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - YOSHIDA Hiroki
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: comable_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 3.2.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 3.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: slim-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Provide backend functions for Comable.
56
+ email:
57
+ - hyoshida@appirits.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - MIT-LICENSE
63
+ - Rakefile
64
+ - app/assets/javascripts/comable/admin/application.js
65
+ - app/assets/javascripts/comable/admin/products.js
66
+ - app/assets/stylesheets/comable/admin/application.css
67
+ - app/assets/stylesheets/comable/admin/products.css
68
+ - app/controllers/comable/admin/application_controller.rb
69
+ - app/controllers/comable/admin/products_controller.rb
70
+ - app/helpers/comable/admin/application_helper.rb
71
+ - app/helpers/comable/admin/products_helper.rb
72
+ - app/views/comable/admin/products/index.slim
73
+ - app/views/layouts/comable/admin/application.slim
74
+ - config/routes.rb
75
+ - lib/comable/backend/engine.rb
76
+ - lib/comable_backend.rb
77
+ - lib/tasks/comable_backend_tasks.rake
78
+ homepage: https://github.com/hyoshida/comable#comable
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.2.2
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Provide backend functions for Comable.
102
+ test_files: []
103
+ has_rdoc: