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 +4 -4
- data/Rakefile +3 -0
- data/app/assets/javascripts/librails/application.js +13 -0
- data/app/assets/stylesheets/librails/application.css +15 -0
- data/app/controllers/librails/application_controller.rb +5 -0
- data/app/helpers/librails/application_helper.rb +4 -0
- data/app/views/layouts/librails/application.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/lib/librails/engine.rb +11 -0
- data/lib/librails/version.rb +1 -1
- data/lib/librails/view_helper.rb +9 -0
- data/lib/librails.rb +2 -8
- data/test/dummy/config/routes.rb +1 -53
- data/test/dummy/config/secrets.yml +2 -2
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +16 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +4 -0
- data/test/dummy/log/test.log +31 -4
- data/test/integration/navigation_test.rb +8 -0
- data/test/librails_test.rb +6 -8
- data/test/test_helper.rb +1 -0
- metadata +18 -3
- data/lib/librails/view_helpers/action_view.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b3b599439a0a84bc032236af5a5e57b4ae4a17f
|
4
|
+
data.tar.gz: 1109cf1a28be35fb227e72938b4ba610b25cb36b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0e996b452d4c45b5f0c47d2d53cfb26ab917115afc8670e96e83f9379f228d24a6eb0f46b48a8bcbfbc72a80b5aff2bcc1812eee1a2d953a9a3fb86468c845c
|
7
|
+
data.tar.gz: 2e4110f2fd62e36257215349c23bf53119237428c419e9d87e1ca2e5e9e937205ade34a8ad233afef79888f68aa983873a1a93a259ccf9cbb8fb3b127333233c
|
data/Rakefile
CHANGED
@@ -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,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
data/lib/librails/version.rb
CHANGED
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
|
data/test/dummy/config/routes.rb
CHANGED
@@ -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
|
-
|
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:
|
14
|
+
secret_key_base: 138b7972c5e2b8bc8c5748fe05a022350b15f0d2c1d83fd11030ab282aef5df05a14c91b7e9da0182d50106f16426aa15f70c039788a5b3eef3f6a3170d1cc88
|
15
15
|
|
16
16
|
test:
|
17
|
-
secret_key_base:
|
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
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -0,0 +1,4 @@
|
|
1
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
data/test/dummy/log/test.log
CHANGED
@@ -1,15 +1,42 @@
|
|
1
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
2
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
5
|
+
[1m[36m (0.8ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
6
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
7
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
8
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
9
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
10
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
11
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
12
|
+
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
13
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1
14
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
2
15
|
------------------------
|
3
|
-
LibrailsTest:
|
16
|
+
LibrailsTest: test_hello
|
4
17
|
------------------------
|
5
18
|
[1m[35m (0.1ms)[0m rollback transaction
|
19
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
20
|
+
[1m[36m (9.0ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
21
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
22
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
23
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
24
|
+
[1m[36m (0.8ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
25
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
6
26
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
27
|
------------------------
|
8
28
|
LibrailsTest: test_hello
|
9
29
|
------------------------
|
10
|
-
[1m[35m (0.
|
30
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
31
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
32
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
33
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
34
|
+
[1m[36m (0.8ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
35
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
36
|
+
[1m[36m (0.8ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
37
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
11
38
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
12
39
|
------------------------
|
13
|
-
LibrailsTest:
|
40
|
+
LibrailsTest: test_hello
|
14
41
|
------------------------
|
15
|
-
[1m[35m (0.
|
42
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
data/test/librails_test.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class LibrailsTest < ActiveSupport::TestCase
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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!',
|
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.
|
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
|
+
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/
|
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
|