librails 0.0.1 → 0.0.2

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: 0b874efb3cf3eb8b64bfe658b145cd728f1314f7
4
- data.tar.gz: 3c1effd5f2188849f7ce053b6277a4dce11a9b58
3
+ metadata.gz: 9b3b599439a0a84bc032236af5a5e57b4ae4a17f
4
+ data.tar.gz: 1109cf1a28be35fb227e72938b4ba610b25cb36b
5
5
  SHA512:
6
- metadata.gz: f22daa67972c5d890a4feb6a5b0cfc1f9db6a16dc12c1cec9a43b58ad85384c46adbdd512da4e671e1d226538c10b7ff3a2fc0ef99949dda113b7a84697c9f65
7
- data.tar.gz: 2d1c4ec5116c3f0fccf037e3741fc9c0321069d591637550448a8ca9ac456a6834e41b222ec0f2ef473b80821a9fbdaad9c704540da8131b9a65f31359cec1b0
6
+ metadata.gz: a0e996b452d4c45b5f0c47d2d53cfb26ab917115afc8670e96e83f9379f228d24a6eb0f46b48a8bcbfbc72a80b5aff2bcc1812eee1a2d953a9a3fb86468c845c
7
+ data.tar.gz: 2e4110f2fd62e36257215349c23bf53119237428c419e9d87e1ca2e5e9e937205ade34a8ad233afef79888f68aa983873a1a93a259ccf9cbb8fb3b127333233c
data/Rakefile CHANGED
@@ -14,8 +14,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include('lib/**/*.rb')
15
15
  end
16
16
 
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
17
19
 
18
20
 
21
+ load 'rails/tasks/statistics.rake'
19
22
 
20
23
 
21
24
 
@@ -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 any plugin's vendor/assets/javascripts directory 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/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -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 any plugin's vendor/assets/stylesheets directory 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,5 @@
1
+ module Librails
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Librails
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Librails</title>
5
+ <%= stylesheet_link_tag "librails/application", media: "all" %>
6
+ <%= javascript_include_tag "librails/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Librails::Engine.routes.draw do
2
+ end
@@ -0,0 +1,11 @@
1
+ module Librails
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Librails
4
+ initializer "librails.view_helper" do |app|
5
+ ActiveSupport.on_load :action_view do
6
+ require 'librails/view_helper'
7
+ include Librails::ViewHelper
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module Librails
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,9 @@
1
+ require 'action_view'
2
+
3
+ module Librails
4
+ module ViewHelper
5
+ def hello_method2
6
+ 'Hello World!2'
7
+ end
8
+ end
9
+ end
data/lib/librails.rb CHANGED
@@ -1,10 +1,4 @@
1
+ require "librails/engine"
2
+
1
3
  module Librails
2
- class Railtie < ::Rails::Railtie
3
- initializer "librails.configure_view_controller" do |app|
4
- ActiveSupport.on_load :action_view do
5
- require 'librails/view_helpers/action_view'
6
- include Librails::ViewHelpers::ActionView
7
- end
8
- end
9
- end
10
4
  end
@@ -1,56 +1,4 @@
1
1
  Rails.application.routes.draw do
2
- # The priority is based upon order of creation: first created -> highest priority.
3
- # See how all your routes lay out with "rake routes".
4
2
 
5
- # You can have the root of your site routed with "root"
6
- # root 'welcome#index'
7
-
8
- # Example of regular route:
9
- # get 'products/:id' => 'catalog#view'
10
-
11
- # Example of named route that can be invoked with purchase_url(id: product.id)
12
- # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
-
14
- # Example resource route (maps HTTP verbs to controller actions automatically):
15
- # resources :products
16
-
17
- # Example resource route with options:
18
- # resources :products do
19
- # member do
20
- # get 'short'
21
- # post 'toggle'
22
- # end
23
- #
24
- # collection do
25
- # get 'sold'
26
- # end
27
- # end
28
-
29
- # Example resource route with sub-resources:
30
- # resources :products do
31
- # resources :comments, :sales
32
- # resource :seller
33
- # end
34
-
35
- # Example resource route with more complex sub-resources:
36
- # resources :products do
37
- # resources :comments
38
- # resources :sales do
39
- # get 'recent', on: :collection
40
- # end
41
- # end
42
-
43
- # Example resource route with concerns:
44
- # concern :toggleable do
45
- # post 'toggle'
46
- # end
47
- # resources :posts, concerns: :toggleable
48
- # resources :photos, concerns: :toggleable
49
-
50
- # Example resource route within a namespace:
51
- # namespace :admin do
52
- # # Directs /admin/products/* to Admin::ProductsController
53
- # # (app/controllers/admin/products_controller.rb)
54
- # resources :products
55
- # end
3
+ mount Librails::Engine => "/librails"
56
4
  end
@@ -11,10 +11,10 @@
11
11
  # if you're sharing your code publicly.
12
12
 
13
13
  development:
14
- secret_key_base: a30ab200ab1d5a9e4aeffe6c3a7cc29b3c12a178a7dc7fe8aa684c276b42dc3e6efdc8db93f47917132470561fcf5b8c2f7127e841c282d6410bfbf5be485259
14
+ secret_key_base: 138b7972c5e2b8bc8c5748fe05a022350b15f0d2c1d83fd11030ab282aef5df05a14c91b7e9da0182d50106f16426aa15f70c039788a5b3eef3f6a3170d1cc88
15
15
 
16
16
  test:
17
- secret_key_base: 03deb22aacd338305237b5d7a0e43f2665026b3bc8307ba9ed0bbbc342c8dc6d0b27bcbf854e60b56dc1a52a73011e07d6e3309dbf707a67629ceff9a3bbb0b9
17
+ secret_key_base: 274bfa82d7395c674d88f10deb2de8b82f859d82ac873eabac872694915d2193f6cb872994ca7625b75e310b4994c27589cf679e08e084013b197d249d41c47c
18
18
 
19
19
  # Do not keep production secrets in the repository,
20
20
  # instead read values from the environment.
Binary file
@@ -0,0 +1,16 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 0) do
15
+
16
+ end
Binary file
@@ -0,0 +1,4 @@
1
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -1,15 +1,42 @@
1
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+  (0.1ms) SELECT version FROM "schema_migrations"
5
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
6
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
7
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
8
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
9
+  (0.1ms) select sqlite_version(*)
10
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
11
+  (0.1ms) SELECT version FROM "schema_migrations"
12
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
13
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1
14
   (0.1ms) begin transaction
2
15
  ------------------------
3
- LibrailsTest: test_truth
16
+ LibrailsTest: test_hello
4
17
  ------------------------
5
18
   (0.1ms) rollback transaction
19
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
20
+  (9.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
21
+  (0.1ms) select sqlite_version(*)
22
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
23
+  (0.1ms) SELECT version FROM "schema_migrations"
24
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
25
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
6
26
   (0.1ms) begin transaction
7
27
  ------------------------
8
28
  LibrailsTest: test_hello
9
29
  ------------------------
10
-  (0.0ms) rollback transaction
30
+  (0.1ms) rollback transaction
31
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
32
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
33
+  (0.1ms) select sqlite_version(*)
34
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
35
+  (0.1ms) SELECT version FROM "schema_migrations"
36
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
37
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
38
   (0.1ms) begin transaction
12
39
  ------------------------
13
- LibrailsTest: test_truth
40
+ LibrailsTest: test_hello
14
41
  ------------------------
15
-  (0.0ms) rollback transaction
42
+  (0.1ms) rollback transaction
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
8
+
@@ -1,14 +1,12 @@
1
1
  require 'test_helper'
2
2
 
3
3
  class LibrailsTest < ActiveSupport::TestCase
4
- include Librails::ViewHelpers::ActionView
5
-
6
- test "truth" do
7
- assert_kind_of Module, Librails
8
- end
4
+ # test "truth" do
5
+ # assert_kind_of Module, Librails
6
+ # end
7
+ include Librails::ViewHelper
9
8
 
10
9
  def test_hello
11
- assert_equal('Hello World!', hello_method)
12
- end
10
+ assert_equal('Hello World!2', hello_method2)
11
+ end
13
12
  end
14
-
data/test/test_helper.rb CHANGED
@@ -3,6 +3,7 @@ ENV["RAILS_ENV"] = "test"
3
3
 
4
4
  require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
5
  ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
+ ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
6
7
  require "rails/test_help"
7
8
 
8
9
  # Filter out Minitest backtrace while allowing backtrace from other libraries
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: librails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - src
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-11 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -48,9 +48,16 @@ files:
48
48
  - MIT-LICENSE
49
49
  - README.rdoc
50
50
  - Rakefile
51
+ - app/assets/javascripts/librails/application.js
52
+ - app/assets/stylesheets/librails/application.css
53
+ - app/controllers/librails/application_controller.rb
54
+ - app/helpers/librails/application_helper.rb
55
+ - app/views/layouts/librails/application.html.erb
56
+ - config/routes.rb
51
57
  - lib/librails.rb
58
+ - lib/librails/engine.rb
52
59
  - lib/librails/version.rb
53
- - lib/librails/view_helpers/action_view.rb
60
+ - lib/librails/view_helper.rb
54
61
  - lib/tasks/librails_tasks.rake
55
62
  - test/dummy/README.rdoc
56
63
  - test/dummy/Rakefile
@@ -82,12 +89,16 @@ files:
82
89
  - test/dummy/config/locales/en.yml
83
90
  - test/dummy/config/routes.rb
84
91
  - test/dummy/config/secrets.yml
92
+ - test/dummy/db/development.sqlite3
93
+ - test/dummy/db/schema.rb
85
94
  - test/dummy/db/test.sqlite3
95
+ - test/dummy/log/development.log
86
96
  - test/dummy/log/test.log
87
97
  - test/dummy/public/404.html
88
98
  - test/dummy/public/422.html
89
99
  - test/dummy/public/500.html
90
100
  - test/dummy/public/favicon.ico
101
+ - test/integration/navigation_test.rb
91
102
  - test/librails_test.rb
92
103
  - test/test_helper.rb
93
104
  homepage: ''
@@ -143,7 +154,10 @@ test_files:
143
154
  - test/dummy/config/routes.rb
144
155
  - test/dummy/config/secrets.yml
145
156
  - test/dummy/config.ru
157
+ - test/dummy/db/development.sqlite3
158
+ - test/dummy/db/schema.rb
146
159
  - test/dummy/db/test.sqlite3
160
+ - test/dummy/log/development.log
147
161
  - test/dummy/log/test.log
148
162
  - test/dummy/public/404.html
149
163
  - test/dummy/public/422.html
@@ -151,5 +165,6 @@ test_files:
151
165
  - test/dummy/public/favicon.ico
152
166
  - test/dummy/Rakefile
153
167
  - test/dummy/README.rdoc
168
+ - test/integration/navigation_test.rb
154
169
  - test/librails_test.rb
155
170
  - test/test_helper.rb
@@ -1,11 +0,0 @@
1
- require 'action_view'
2
-
3
- module Librails
4
- module ViewHelpers
5
- module ActionView
6
- def hello_method
7
- 'Hello World!'
8
- end
9
- end
10
- end
11
- end