skins 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +34 -0
  4. data/lib/generators/skins/install_generator.rb +14 -0
  5. data/lib/skins.rb +4 -0
  6. data/lib/skins/engine.rb +4 -0
  7. data/lib/skins/version.rb +3 -0
  8. data/lib/tasks/skins_tasks.rake +4 -0
  9. data/test/dummy/README.rdoc +28 -0
  10. data/test/dummy/Rakefile +6 -0
  11. data/test/dummy/app/assets/javascripts/application.js +15 -0
  12. data/test/dummy/app/assets/stylesheets/application.css +14 -0
  13. data/test/dummy/app/controllers/application_controller.rb +5 -0
  14. data/test/dummy/app/controllers/books_controller.rb +58 -0
  15. data/test/dummy/app/helpers/application_helper.rb +2 -0
  16. data/test/dummy/app/helpers/books_helper.rb +2 -0
  17. data/test/dummy/app/models/book.rb +2 -0
  18. data/test/dummy/app/views/books/_form.html.erb +41 -0
  19. data/test/dummy/app/views/books/edit.html.erb +6 -0
  20. data/test/dummy/app/views/books/index.html.erb +37 -0
  21. data/test/dummy/app/views/books/new.html.erb +5 -0
  22. data/test/dummy/app/views/books/show.html.erb +34 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +15 -0
  24. data/test/dummy/bin/bundle +3 -0
  25. data/test/dummy/bin/rails +4 -0
  26. data/test/dummy/bin/rake +4 -0
  27. data/test/dummy/bin/setup +29 -0
  28. data/test/dummy/config.ru +4 -0
  29. data/test/dummy/config/application.rb +26 -0
  30. data/test/dummy/config/boot.rb +5 -0
  31. data/test/dummy/config/database.yml +25 -0
  32. data/test/dummy/config/environment.rb +5 -0
  33. data/test/dummy/config/environments/development.rb +41 -0
  34. data/test/dummy/config/environments/production.rb +76 -0
  35. data/test/dummy/config/environments/test.rb +39 -0
  36. data/test/dummy/config/initializers/assets.rb +11 -0
  37. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  38. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  39. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/test/dummy/config/initializers/inflections.rb +16 -0
  41. data/test/dummy/config/initializers/mime_types.rb +4 -0
  42. data/test/dummy/config/initializers/session_store.rb +3 -0
  43. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/test/dummy/config/locales/en.yml +23 -0
  45. data/test/dummy/config/routes.rb +60 -0
  46. data/test/dummy/config/secrets.yml +22 -0
  47. data/test/dummy/db/development.sqlite3 +0 -0
  48. data/test/dummy/db/migrate/20141116110032_create_books.rb +14 -0
  49. data/test/dummy/db/schema.rb +27 -0
  50. data/test/dummy/log/development.log +745 -0
  51. data/test/dummy/public/404.html +67 -0
  52. data/test/dummy/public/422.html +67 -0
  53. data/test/dummy/public/500.html +66 -0
  54. data/test/dummy/public/favicon.ico +0 -0
  55. data/test/dummy/test/controllers/books_controller_test.rb +49 -0
  56. data/test/dummy/test/fixtures/books.yml +17 -0
  57. data/test/dummy/test/models/book_test.rb +7 -0
  58. data/test/dummy/tmp/cache/assets/development/sprockets/071c61ef79e58c05e615b775c9c6ed05 +0 -0
  59. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  60. data/test/dummy/tmp/cache/assets/development/sprockets/20f668d2168c84faddd7eef38ec0f9a5 +0 -0
  61. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  62. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  63. data/test/dummy/tmp/cache/assets/development/sprockets/6fbd6219c2326eddd846c76ce72f1a4a +0 -0
  64. data/test/dummy/tmp/cache/assets/development/sprockets/876a7f88918317e09955c0c022211db6 +0 -0
  65. data/test/dummy/tmp/cache/assets/development/sprockets/97d8ab493374caffba772b190453211b +0 -0
  66. data/test/dummy/tmp/cache/assets/development/sprockets/a208afbd77920156810272b332e20d8e +0 -0
  67. data/test/dummy/tmp/cache/assets/development/sprockets/bb9ce87fadb7e2d4530b504849626f51 +0 -0
  68. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  69. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  70. data/test/dummy/tmp/cache/assets/development/sprockets/df0e607dd6f2c5ab363850690e402621 +0 -0
  71. data/test/dummy/tmp/cache/assets/development/sprockets/e945dd96f47babf994a0b0afc85f4a15 +0 -0
  72. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  73. data/test/skins_test.rb +7 -0
  74. data/test/test_helper.rb +15 -0
  75. metadata +226 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 40cdb04c1e6c3d5bf3cbc06011cae426df22068f
4
+ data.tar.gz: eb05bfe491224a264aa3310d2477e71493a3c9ac
5
+ SHA512:
6
+ metadata.gz: 57c17ee9e9acc2bc1619ee9e9fd988e9334c8ce17360f911076dea4a3c128c910d2b853cfb9c1044d08338a3503a5cf8d48dde818edbd30f60edd7265ba3a456
7
+ data.tar.gz: 3145a0c5d4d29505666bb8b3df2b6a7b96e3da6fe00b1e69de05df5e8ad4b4f8d41c4213bab6a257601de6f7aceca3ba52f30b1f12cb8de6d7c29500e437311c
@@ -0,0 +1,20 @@
1
+ Copyright 2014 Arti Sinani
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,34 @@
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
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Skins'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,14 @@
1
+ module Skins
2
+ class InstallGenerator < Rails::Generators::Base
3
+ desc "Install a skin to your Rails app"
4
+
5
+ def info
6
+ puts "Install a skin to your Rails app"
7
+ end
8
+
9
+ def copy_fonts
10
+ link = "<link href='http://fonts.googleapis.com/css?family=Quicksand:400,700' rel='stylesheet' type='text/css'>"
11
+ insert_into_file "app/views/layouts/application.html.erb", link, :before => "</head>"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,4 @@
1
+ require 'skins/engine'
2
+
3
+ module Skins
4
+ end
@@ -0,0 +1,4 @@
1
+ module Skins
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module Skins
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :skins do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,15 @@
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 jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,14 @@
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 skins-air
14
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,58 @@
1
+ class BooksController < ApplicationController
2
+ before_action :set_book, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /books
5
+ def index
6
+ @books = Book.all
7
+ end
8
+
9
+ # GET /books/1
10
+ def show
11
+ end
12
+
13
+ # GET /books/new
14
+ def new
15
+ @book = Book.new
16
+ end
17
+
18
+ # GET /books/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /books
23
+ def create
24
+ @book = Book.new(book_params)
25
+
26
+ if @book.save
27
+ redirect_to @book, notice: 'Book was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /books/1
34
+ def update
35
+ if @book.update(book_params)
36
+ redirect_to @book, notice: 'Book was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /books/1
43
+ def destroy
44
+ @book.destroy
45
+ redirect_to books_url, notice: 'Book was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_book
51
+ @book = Book.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def book_params
56
+ params.require(:book).permit(:title, :author, :description, :price, :published_at, :discounted)
57
+ end
58
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module BooksHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class Book < ActiveRecord::Base
2
+ end
@@ -0,0 +1,41 @@
1
+ <%= form_for(@book) do |f| %>
2
+ <% if @book.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@book.errors.count, "error") %> prohibited this book from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @book.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :title %><br>
16
+ <%= f.text_field :title %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :author %><br>
20
+ <%= f.text_field :author %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :description %><br>
24
+ <%= f.text_area :description %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :price %><br>
28
+ <%= f.text_field :price %>
29
+ </div>
30
+ <div class="field">
31
+ <%= f.label :published_at %><br>
32
+ <%= f.datetime_select :published_at %>
33
+ </div>
34
+ <div class="field">
35
+ <%= f.label :discounted %><br>
36
+ <%= f.check_box :discounted %>
37
+ </div>
38
+ <div class="actions">
39
+ <%= f.submit %>
40
+ </div>
41
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Book</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @book %> |
6
+ <%= link_to 'Back', books_path %>
@@ -0,0 +1,37 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Listing Books</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Title</th>
9
+ <th>Author</th>
10
+ <th>Description</th>
11
+ <th>Price</th>
12
+ <th>Published at</th>
13
+ <th>Discounted</th>
14
+ <th colspan="3"></th>
15
+ </tr>
16
+ </thead>
17
+
18
+ <tbody>
19
+ <% @books.each do |book| %>
20
+ <tr>
21
+ <td><%= book.title %></td>
22
+ <td><%= book.author %></td>
23
+ <td><%= book.description %></td>
24
+ <td><%= book.price %></td>
25
+ <td><%= book.published_at %></td>
26
+ <td><%= book.discounted %></td>
27
+ <td><%= link_to 'Show', book %></td>
28
+ <td><%= link_to 'Edit', edit_book_path(book) %></td>
29
+ <td><%= link_to 'Destroy', book, method: :delete, data: { confirm: 'Are you sure?' } %></td>
30
+ </tr>
31
+ <% end %>
32
+ </tbody>
33
+ </table>
34
+
35
+ <br>
36
+
37
+ <%= link_to 'New Book', new_book_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Book</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', books_path %>
@@ -0,0 +1,34 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Title:</strong>
5
+ <%= @book.title %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Author:</strong>
10
+ <%= @book.author %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Description:</strong>
15
+ <%= @book.description %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Price:</strong>
20
+ <%= @book.price %>
21
+ </p>
22
+
23
+ <p>
24
+ <strong>Published at:</strong>
25
+ <%= @book.published_at %>
26
+ </p>
27
+
28
+ <p>
29
+ <strong>Discounted:</strong>
30
+ <%= @book.discounted %>
31
+ </p>
32
+
33
+ <%= link_to 'Edit', edit_book_path(@book) %> |
34
+ <%= link_to 'Back', books_path %>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ <link href='http://fonts.googleapis.com/css?family=Quicksand:400,700' rel='stylesheet' type='text/css'>
9
+ </head>
10
+ <body class="skins-air">
11
+
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end