rtrain 0.2.3 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/rtrain.gemspec +5 -4
  3. metadata +17 -46
  4. data/README.md +0 -42
  5. data/docs-img/quick_demo_inputs.md +0 -36
  6. data/docs-img/rtrain-placeholder.png +0 -0
  7. data/lib/generators/controllers/main_controller.rb +0 -5
  8. data/lib/generators/controllers/sessions_app_controller.rb +0 -11
  9. data/lib/generators/controllers/user_sessions_controller.rb +0 -27
  10. data/lib/generators/controllers/users_controller.rb +0 -21
  11. data/lib/generators/models/user.rb +0 -5
  12. data/lib/generators/models/user_session.rb +0 -2
  13. data/lib/generators/rtrain/install_generator.rb +0 -314
  14. data/lib/generators/sessions/sessions_routes.rb +0 -6
  15. data/lib/generators/shared/_errors.html.erb +0 -13
  16. data/lib/generators/templates/forms.scss +0 -35
  17. data/lib/generators/templates/home.html.erb +0 -21
  18. data/lib/generators/templates/nav-bar.scss +0 -25
  19. data/lib/generators/templates/rtrain-application.html.erb +0 -18
  20. data/lib/generators/templates/rtrain_scaffold.scss +0 -135
  21. data/lib/generators/templates/sign-in.scss +0 -31
  22. data/lib/generators/user_sessions/new.html.erb +0 -22
  23. data/lib/generators/users/new.html.erb +0 -22
  24. data/lib/rtrain.rb +0 -2
  25. data/rtrain-0.0.1.gem +0 -0
  26. data/rtrain-0.0.2.gem +0 -0
  27. data/rtrain-0.0.3.gem +0 -0
  28. data/rtrain-0.0.4.gem +0 -0
  29. data/rtrain-0.0.5.gem +0 -0
  30. data/rtrain-0.0.6.gem +0 -0
  31. data/rtrain-0.0.7.gem +0 -0
  32. data/rtrain-0.0.8.gem +0 -0
  33. data/rtrain-0.0.9.gem +0 -0
  34. data/rtrain-0.1.0.gem +0 -0
  35. data/rtrain-0.1.1.gem +0 -0
  36. data/rtrain-0.1.2.gem +0 -0
  37. data/rtrain-0.1.3.gem +0 -0
  38. data/rtrain-0.1.4.gem +0 -0
  39. data/rtrain-0.1.5.gem +0 -0
  40. data/rtrain-0.1.6.gem +0 -0
  41. data/rtrain-0.1.7.gem +0 -0
  42. data/rtrain-0.1.8.gem +0 -0
  43. data/rtrain-0.1.9.gem +0 -0
  44. data/rtrain-0.2.0.gem +0 -0
  45. data/rtrain-0.2.1.gem +0 -0
  46. data/rtrain-0.2.2.gem +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b2e1b5c77d0f4bbc2eeaaec8d9994b0c1fd9cbf
4
- data.tar.gz: ab7e0dcae428fb1176349e295dcb9327bb91b9f5
3
+ metadata.gz: 64de8d396f786412dc0ba87646027ff1d70f3f44
4
+ data.tar.gz: 6a4e5db91f9b31191c8ecd957489a4866c7078fd
5
5
  SHA512:
6
- metadata.gz: 62eb0f21075a2268cd70dcea86a8fd2d44f4dc0409d78b4d49e54ed20467852d43f9fd236900a86fcb35e017aca38dcd4b7b4c65d23773bcb2875828d5c8af12
7
- data.tar.gz: 3072d75507acd583da52a56091bfea9827a551a552246074dec1905f15111690b847131f5f2dcbbcc51d2f5118571a7884386824edde74f0d461c0a88b16f18b
6
+ metadata.gz: 057131b15519731e943e1638c98e05496f7e258de4cb788696d5cae153da570673d0d15f9ab7d5f66c7d3d9e003c2c80095063a7957c28cd7e517623b35d6c51
7
+ data.tar.gz: e4927a45d6a6bdce4a1bbda0bd43f2b50a32bde5e5d622a7eb00177015a0dc860b3592165192ee2ac2647624538463d65dce238196b3ed0b842d0a8b90ac98cc
data/rtrain.gemspec CHANGED
@@ -4,14 +4,15 @@ $LOAD_PATH.push File.expand_path("../lib", __FILE__)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'rtrain'
7
- s.version = '0.2.3'
8
- s.date = '2016-05-31'
9
- s.summary = "Nicer Scaffolds,nav bar, static homepage for Rails"
7
+ s.version = '0.2.5'
8
+ s.date = '2016-06-01'
9
+ s.summary = "Nicer Scaffolds,nav bar, static homepage for Rails, and more"
10
10
  s.description = "Rails UI Booster - More info @ https://github.com/lynnd335/rtrain"
11
11
  s.authors = ["Dan Lynn"]
12
12
  s.email = 'lynnd335@gmail.com'
13
- s.files = Dir['**/*']
13
+ s.files = Dir['**/*'].delete('rtrain.gemspec')
14
14
  s.homepage = 'http://rubygems.org/gems/rtrain'
15
15
  s.license = 'MIT'
16
16
  s.add_runtime_dependency 'authlogic', '~> 3.4', '>= 3.4.6'
17
+ s.add_runtime_dependency 'ffaker', '~> 0'
17
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtrain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Lynn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: authlogic
@@ -30,55 +30,26 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.4.6
33
+ - !ruby/object:Gem::Dependency
34
+ name: ffaker
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
33
47
  description: Rails UI Booster - More info @ https://github.com/lynnd335/rtrain
34
48
  email: lynnd335@gmail.com
35
49
  executables: []
36
50
  extensions: []
37
51
  extra_rdoc_files: []
38
52
  files:
39
- - README.md
40
- - docs-img/quick_demo_inputs.md
41
- - docs-img/rtrain-placeholder.png
42
- - lib/generators/controllers/main_controller.rb
43
- - lib/generators/controllers/sessions_app_controller.rb
44
- - lib/generators/controllers/user_sessions_controller.rb
45
- - lib/generators/controllers/users_controller.rb
46
- - lib/generators/models/user.rb
47
- - lib/generators/models/user_session.rb
48
- - lib/generators/rtrain/install_generator.rb
49
- - lib/generators/sessions/sessions_routes.rb
50
- - lib/generators/shared/_errors.html.erb
51
- - lib/generators/templates/forms.scss
52
- - lib/generators/templates/home.html.erb
53
- - lib/generators/templates/nav-bar.scss
54
- - lib/generators/templates/rtrain-application.html.erb
55
- - lib/generators/templates/rtrain_scaffold.scss
56
- - lib/generators/templates/sign-in.scss
57
- - lib/generators/user_sessions/new.html.erb
58
- - lib/generators/users/new.html.erb
59
- - lib/rtrain.rb
60
- - rtrain-0.0.1.gem
61
- - rtrain-0.0.2.gem
62
- - rtrain-0.0.3.gem
63
- - rtrain-0.0.4.gem
64
- - rtrain-0.0.5.gem
65
- - rtrain-0.0.6.gem
66
- - rtrain-0.0.7.gem
67
- - rtrain-0.0.8.gem
68
- - rtrain-0.0.9.gem
69
- - rtrain-0.1.0.gem
70
- - rtrain-0.1.1.gem
71
- - rtrain-0.1.2.gem
72
- - rtrain-0.1.3.gem
73
- - rtrain-0.1.4.gem
74
- - rtrain-0.1.5.gem
75
- - rtrain-0.1.6.gem
76
- - rtrain-0.1.7.gem
77
- - rtrain-0.1.8.gem
78
- - rtrain-0.1.9.gem
79
- - rtrain-0.2.0.gem
80
- - rtrain-0.2.1.gem
81
- - rtrain-0.2.2.gem
82
53
  - rtrain.gemspec
83
54
  homepage: http://rubygems.org/gems/rtrain
84
55
  licenses:
@@ -103,5 +74,5 @@ rubyforge_project:
103
74
  rubygems_version: 2.4.5.1
104
75
  signing_key:
105
76
  specification_version: 4
106
- summary: Nicer Scaffolds,nav bar, static homepage for Rails
77
+ summary: Nicer Scaffolds,nav bar, static homepage for Rails, and more
107
78
  test_files: []
data/README.md DELETED
@@ -1,42 +0,0 @@
1
- # RTrain
2
- ![Ugh](http://www.heyridge.com/wp-content/uploads/2015/03/File-2012-12-29-R-train.jpg)
3
- _Ugh._
4
-
5
- #Rails Downloadable Content (DLC) Expansion Pack
6
- Adds better CSS to scaffold, HTML navigation, more features are in the pipe, so stay tuned ... _DLC Season Pass Coming Soon Too!_
7
-
8
-
9
- #How to use RTrain
10
-
11
- _It is HIGHLY recommended that developers using RTrain execute these generator commands in sequence, and to always scaffold generate all models!!!_
12
-
13
- **Put this in your Gemfile**
14
- ```
15
- gem 'rtrain', '~> 0.2.0'
16
- ```
17
- Then `bundle install`
18
-
19
- **After generating a scaffold, enter any of these into the command line:**
20
-
21
- ```
22
- rails generate rtrain:install --copy_css
23
- ```
24
- ![Ugh](http://i.imgur.com/xzbeMWC.png)
25
- _Oooooooooooooo!_
26
-
27
- Turns your basic scaffold into something that's at least tolerable to look at!
28
-
29
- **Add a sweet nav bar!**
30
- ```
31
- rails generate rtrain:install --copy_css
32
- ```
33
- ![Ugh](http://i.imgur.com/hywhd0t.png)
34
-
35
- **Add a home page controller and view, and set it as the root**
36
- ```
37
- rails generate rtrain:install --add_homepage
38
- ```
39
- ![Ugh](http://i.imgur.com/LuNqg3O.png)
40
-
41
-
42
- More to come! Stay tuned!
@@ -1,36 +0,0 @@
1
- #Quick Demo Inputs
2
-
3
- Use these commands to spin up some dummy data using the FFaker Gem (with Hipster Ipsum)
4
-
5
- In the command line:
6
- ```
7
- gem install ffaker
8
-
9
- ```
10
-
11
- In your Rails app's Gemfile add
12
-
13
- ```
14
- require 'ffaker'
15
- ```
16
-
17
- Go back to the command line
18
-
19
- ```
20
- rails g scaffold contacts name:string address:string phone:string email_address:string about:string
21
-
22
- rake db:create db:migrate
23
-
24
- rails g scaffold comments subject:string content:text
25
-
26
- rake db:migrate
27
- ```
28
-
29
- In Rails Console ($rails c)
30
- ```
31
- 40.times do Contact.create(name: FFaker::Name.name, address: FFaker::AddressUS.street_address + ", " + FFaker::AddressUS.city + ", " + FFaker::AddressUS.state + " " + FFaker::AddressUS.zip_code, phone: FFaker::PhoneNumber.short_phone_number,email_address: FFaker::Internet.email, about: FFaker::HipsterIpsum.phrase)end
32
-
33
- 40.times do Comment.create(subject: FFaker::HipsterIpsum.phrase, content: FFaker::HipsterIpsum.paragraph)end
34
- ```
35
-
36
- Now you've got some bangin' filler data!
Binary file
@@ -1,5 +0,0 @@
1
- class MainController < ApplicationController
2
- def show
3
- render template: "main/#{params[:page]}"
4
- end
5
- end
@@ -1,11 +0,0 @@
1
- def current_user_session
2
- return @current_user_session if defined?(@current_user_session)
3
- @current_user_session = UserSession.find
4
- end
5
-
6
- def current_user
7
- return @current_user if defined?(@current_user)
8
- @current_user = current_user_session && current_user_session.user
9
- end
10
-
11
- helper_method :current_user_session, :current_user
@@ -1,27 +0,0 @@
1
- class UserSessionsController < ApplicationController
2
- def new
3
- @user_session = UserSession.new
4
- end
5
-
6
- def create
7
- @user_session = UserSession.new(user_session_params)
8
- if @user_session.save
9
- flash[:success] = "Welcome back!"
10
- redirect_to root_path
11
- else
12
- render :new
13
- end
14
- end
15
-
16
- def destroy
17
- current_user_session.destroy
18
- flash[:success] = "Goodbye!"
19
- redirect_to root_path
20
- end
21
-
22
- private
23
-
24
- def user_session_params
25
- params.require(:user_session).permit(:email, :password, :remember_me)
26
- end
27
- end
@@ -1,21 +0,0 @@
1
- class UsersController < ApplicationController
2
- def new
3
- @user = User.new
4
- end
5
-
6
- def create
7
- @user = User.new(users_params)
8
- if @user.save
9
- flash[:success] = "Account registered!"
10
- redirect_to root_path
11
- else
12
- render :new
13
- end
14
- end
15
-
16
- private
17
-
18
- def users_params
19
- params.require(:user).permit(:email, :password, :password_confirmation)
20
- end
21
- end
@@ -1,5 +0,0 @@
1
- class User < ActiveRecord::Base
2
- acts_as_authentic do |c|
3
- c.crypto_provider = Authlogic::CryptoProviders::Sha512
4
- end
5
- end
@@ -1,2 +0,0 @@
1
- class UserSession < Authlogic::Session::Base
2
- end
@@ -1,314 +0,0 @@
1
- module Rtrain
2
- module Generators
3
- class InstallGenerator < Rails::Generators::Base
4
- desc "Creates a generator for Rtrain to style scaffold tables."
5
- class_option :copy_css, type: :boolean, desc: 'Write some nice CSS for scaffold, comments out original scaffold css'
6
- class_option :add_nav, type: :boolean, desc: 'Makes a wicked sweet nav bar for your rails app'
7
- class_option :add_homepage, type: :boolean, desc: 'Adds a home page controller and view and updates it to be the root URL'
8
- class_option :add_user_sessions, type: :boolean, desc: 'Builds user and user sessions models, adds Sign-up and sign-in links to application layout, requires login before records can be added to a form'
9
-
10
- def gem_info
11
- return if options.copy_css? || options.add_nav? || options.add_homepage? || options.add_user_sessions?
12
- puts "
13
- ----------------------------------------------------
14
- Rtrain needs an argument to continue.
15
- Please re-run the install generator with one of the
16
- following options:
17
- \n
18
- --copy_css
19
- --add_nav
20
- --add_homepage
21
- --add_user_sessions
22
- \n
23
- Refer to the README at https://github.com/lynnd335/rtrain
24
- for details and illustrations of each option's executions
25
- ----------------------------------------------------
26
- "
27
- end
28
-
29
- def run_rtrain
30
- dir = File.dirname(__FILE__)
31
-
32
-
33
-
34
- ##create rtrain logfile or open it if it already exists
35
- if !File.exist?("rtrain_log.txt")
36
- rtrain_log = File.new("rtrain_log.txt", "a")
37
- puts "\n
38
- ----------------------------------------------------
39
- Rtrain logfile created in main directory of app
40
- ----------------------------------------------------
41
- \n
42
- "
43
- else
44
- rtrain_log = open("rtrain_log.txt", "a")
45
- end
46
- rtrain_log_read = open(rtrain_log).read
47
- ##end create rtrain logfile
48
-
49
- ##add lines to config/routes.rb for auth
50
- routes_rb = open("config/routes.rb").read
51
- if !routes_rb.match("#session routes here")
52
- routes_rb['#'] = "\n#session routes here\n#"
53
- end
54
- routes_rb_write = open("config/routes.rb", "w")
55
- routes_rb_write.write(routes_rb)
56
- routes_rb_write.close
57
- ##end
58
-
59
- ##Begin Copy CSS
60
-
61
- if options[:copy_css]
62
- stylesheets = "app/assets/stylesheets/"
63
- new_css = ["../templates/rtrain_scaffold.scss","../templates/forms.scss"]
64
-
65
- new_css.each do |n|
66
- new_css_path = File.join(dir, n)
67
- FileUtils.cp(new_css_path, stylesheets)
68
- end
69
- if !rtrain_log_read.match('_copy_css_run')
70
- scaffold = open("app/assets/stylesheets/scaffolds.scss").read
71
- old_css = open("app/assets/stylesheets/scaffolds.scss", "w")
72
- old_css.write("/*\n" + scaffold + "\n*/")
73
- old_css.close
74
- end
75
- puts "
76
- ----------------------------------------------------
77
- Rtrain Scaffold and forms css documents now active in app/assets/stylesheets/
78
- ----------------------------------------------------
79
- "
80
-
81
- open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_copy_css_run\n"}
82
- end
83
-
84
- ##end copy css
85
-
86
- ##begin add nvigation bar
87
-
88
- if options[:add_nav]
89
- read_applayout = open("app/views/layouts/application.html.erb").read
90
- app_name = read_applayout.split("<title>")[1].split("</title>")[0]
91
- app_name = "\n<h1>"+app_name+"</h1>\n"
92
- tables = ActiveRecord::Base.connection.tables[1..-1]
93
- list_items = []
94
- tables.each do |t|
95
- if t != 'users'
96
- link = "<li><%=link_to '" + t.titleize + "'," + t + "_path%></li>"
97
- list_items.push(link)
98
- end
99
- end
100
-
101
- nav = "\n<div id='main-navbar'>\n\t<ul id='menu'>\n\t\t" + list_items.join("\n\t\t") + "\n\t</ul>\n</div>\t\n\n\n"
102
-
103
-
104
- ##check to see if add_nav has already been run, update via overwrite if true, add if else
105
-
106
- if rtrain_log_read.match('_nav_added')
107
- old_menu = read_applayout.split("<ul id='menu'>")[1].split("</ul>")[0]
108
- if rtrain_log_read.match('_main_view_controller_added')
109
- list_items.unshift("<li><%=link_to 'Main', '/'%></li>")
110
- end
111
- new_menu = list_items.join("\n\t\t")
112
- read_applayout [old_menu] = new_menu
113
- new_applayout = open("app/views/layouts/application.html.erb", "w")
114
- new_applayout.write(read_applayout)
115
- new_applayout.close
116
- open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_nav_updated-" + tables.to_s() + "\n"}
117
- puts "
118
- ----------------------------------------------------
119
- Rtrain Nav Bar updated app/views/layouts/application.html.erb\n
120
- ----------------------------------------------------
121
- "
122
- else
123
- new_layout = read_applayout.split("<body>")
124
- read_applayout = open("app/views/layouts/application.html.erb", "w")
125
- read_applayout.write(new_layout[0] + "<body>" + app_name + nav + new_layout[1])
126
- read_applayout.close
127
- ###
128
- nav_css = "../templates/nav-bar.scss"
129
- nav_css_path = File.join(dir, nav_css)
130
- stylesheets = "app/assets/stylesheets/"
131
- FileUtils.cp(nav_css_path, stylesheets)
132
- puts "
133
- ----------------------------------------------------
134
- Rtrain Nav Bar and App Title now active in app/views/layouts/application.html.erb\n
135
-
136
- IMPORTANT! Be extra careful re-running this command, as it will overwrite to the default styling
137
- ----------------------------------------------------
138
- "
139
- open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_nav_added-" + tables.to_s() + "\n"}
140
- end
141
- # new_applayout.close
142
- end
143
-
144
- ##end add navigation bar
145
-
146
- ##begin add main page
147
-
148
- if options[:add_homepage]
149
- FileUtils.mkdir("app/views/main/")
150
-
151
- home_page = "../templates/home.html.erb"
152
- home_page_path = File.join(dir, home_page)
153
- main_view_dir = "app/views/main/"
154
- FileUtils.cp(home_page_path, main_view_dir)
155
-
156
- main = "../controllers/main_controller.rb"
157
- main_path = File.join(dir, main)
158
- controllers = "app/controllers"
159
- FileUtils.cp(main_path, controllers)
160
-
161
- root = open("config/routes.rb").read
162
- root ["# root 'welcome#index'"] = "root 'main#show', page: 'home'
163
- get '/main/:page' => 'pages#show'"
164
- routes = open("config/routes.rb","w")
165
- routes.write(root)
166
- routes.close
167
-
168
- puts "
169
- ----------------------------------------------------
170
- Rtrain Homepage Now Active and set as root URL, re-run '--add_nav' to have link appear in nav bar
171
- ----------------------------------------------------
172
- "
173
- open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_main_view_controller_added" + "\n"}
174
- end
175
-
176
- ##end add homepage
177
-
178
- ##begin add sessions
179
-
180
-
181
- if options[:add_user_sessions]
182
- if !rtrain_log_read.match('_user_sessions_added')
183
-
184
- FileUtils.mkdir("app/views/users/")
185
- new_users = "../users/new.html.erb"
186
- new_users_path = File.join(dir, new_users)
187
- new_users_dir = "app/views/users/"
188
- FileUtils.cp(new_users_path, new_users_dir)
189
-
190
- FileUtils.mkdir("app/views/user_sessions/")
191
- new_user_sessions = "../user_sessions/new.html.erb"
192
- new_user_sessions_path = File.join(dir, new_user_sessions)
193
- new_user_sessions_dir = "app/views/user_sessions/"
194
- FileUtils.cp(new_user_sessions_path, new_user_sessions_dir)
195
-
196
- FileUtils.mkdir("app/views/shared/")
197
- errors = "../shared/_errors.html.erb"
198
- errors_path = File.join(dir, errors)
199
- errors_dir = "app/views/shared/"
200
- FileUtils.cp(errors_path, errors_dir)
201
-
202
- models = ["../models/user.rb","../models/user_session.rb"]
203
- controllers = ["../controllers/users_controller.rb","../controllers/user_sessions_controller.rb","../controllers/sessions_app_controller.rb"]
204
-
205
- models.each do |m|
206
- models_path = File.join(dir, m)
207
- models_dir = "app/models/"
208
- FileUtils.cp(models_path, models_dir)
209
- end
210
-
211
- controllers.each do |c|
212
- controllers_path = File.join(dir, c)
213
- controllers_dir = "app/controllers/"
214
- FileUtils.cp(controllers_path, controllers_dir)
215
- end
216
-
217
- sessions_app_controller = open("app/controllers/sessions_app_controller.rb").read
218
- app_controller = open("app/controllers/application_controller.rb").read
219
-
220
- if app_controller.match("private")
221
- app_controller ["private"] = "private" + "\n" + sessions_app_controller
222
- else
223
- app_controller[app_controller.rindex('end')...(app_controller.rindex('end') + 'end'.length)] = "test"
224
- end
225
-
226
- current_app_controller = open("app/controllers/application_controller.rb", "w")
227
- current_app_controller.write(app_controller)
228
- current_app_controller.close
229
-
230
-
231
- session_css = "../templates/sign-in.scss"
232
- session_css_path = File.join(dir, session_css)
233
- stylesheets = "app/assets/stylesheets/"
234
- FileUtils.cp(session_css_path, stylesheets)
235
- applayout = open("app/views/layouts/application.html.erb").read
236
- new_layout = applayout.split("<body>")
237
- session_links = "
238
- <div id='signin-bar'>
239
- <% if current_user %>
240
- <span><%= current_user.email %></span>&nbsp;&nbsp;|&nbsp;&nbsp;
241
- <%= link_to 'Sign Out', sign_out_path, method: :delete %>
242
- <% else %>
243
- <%=link_to 'Sign Up', new_user_path%>&nbsp;&nbsp;|&nbsp;&nbsp;
244
- <%= link_to 'Sign In', sign_in_path %>
245
- <% end %>
246
- </div>\n"
247
- new_applayout = open("app/views/layouts/application.html.erb", "w")
248
- new_applayout.write(new_layout[0] + "<body>\n" + session_links + new_layout[1])
249
- new_applayout.close
250
- forms = Dir.glob("app/**/_form.html.erb")
251
- session_check = "
252
- <%if !current_user%>
253
- <div id='blank'>
254
- <div id='alert'>
255
- <h3>Must be SIGNED IN to add item!</h3>
256
- </div>
257
- </div>
258
- <%end%>\n"
259
-
260
- forms.each do |f|
261
- content = open(f).read
262
- form_erb = open(f,"w")
263
- form_erb.write(session_check + content)
264
- form_erb.close
265
- end
266
-
267
- sesh = "
268
- resources :users, only: [:new, :create]
269
-
270
- resources :user_sessions, only: [:create, :destroy]
271
-
272
- delete '/sign_out', to: 'user_sessions#destroy', as: :sign_out
273
- get '/sign_in', to: 'user_sessions#new', as: :sign_in
274
- "
275
-
276
- sesh_route = open("config/routes.rb").read
277
- sesh_route ["#session routes here"] = sesh
278
- routes = open("config/routes.rb","w")
279
- routes.write(sesh_route)
280
- routes.close
281
-
282
- system("bin/rails g migration CreateUser email:string crypted_password:string password_salt:string persistence_token:string")
283
- mig = Dir.glob("db/migrate/**.rb")[-1]
284
- mig_read = open(mig).read
285
- mig_read ["end"] = "\nt.timestamps null: false
286
- end
287
- add_index :users, :email, unique: true"
288
- mig_write = open(mig, 'w')
289
- mig_write.write(mig_read)
290
- mig_write.close
291
-
292
-
293
- system("bundle exec rake db:migrate")
294
- puts "
295
- ----------------------------------------------------
296
- Rtrain User Sessions Now Active
297
- ----------------------------------------------------
298
- "
299
- open(rtrain_log, 'a') { |f| f.puts Time.now().to_s() + "_user_sessions_added" + "\n"}
300
- else
301
- puts "
302
- ----------------------------------------------------
303
- Rtrain User Sessions Already Active - Cannot re-run!
304
- ----------------------------------------------------
305
- "
306
- end
307
- end
308
-
309
- ##end users sessions install
310
- rtrain_log.close
311
- end
312
- end
313
- end
314
- end
@@ -1,6 +0,0 @@
1
- resources :users, only: [:new, :create]
2
-
3
- resources :user_sessions, only: [:create, :destroy]
4
-
5
- delete '/sign_out', to: 'user_sessions#destroy', as: :sign_out
6
- get '/sign_in', to: 'user_sessions#new', as: :sign_in
@@ -1,13 +0,0 @@
1
- <% if object.errors.any? %>
2
- <div class="panel panel-warning errors">
3
- <div class="panel-heading">
4
- <h5><i class="glyphicon glyphicon-exclamation-sign"></i> Found errors while saving</h5>
5
- </div>
6
-
7
- <ul class="panel-body">
8
- <% object.errors.full_messages.each do |msg| %>
9
- <li><%= msg %></li>
10
- <% end %>
11
- </ul>
12
- </div>
13
- <% end %>
@@ -1,35 +0,0 @@
1
- label{
2
- font-size: 16px;
3
- font-weight: bold;
4
- margin-top: 4px;
5
- }
6
-
7
- input[type=text], select {
8
- width: 90%;
9
- padding: 12px 20px;
10
- display: inline-block;
11
- border: 1px solid #ccc;
12
- border-radius: 4px;
13
- box-sizing: border-box;
14
- }
15
- textarea{
16
- width: 90%;
17
- height: 150px;
18
- padding: 12px 20px;
19
- box-sizing: border-box;
20
- border: 2px solid #ccc;
21
- border-radius: 4px;
22
- resize: none;
23
- }
24
- input[type=submit] {
25
- width: 90%;
26
- background-color: #3a3a3a;
27
- color: white;
28
- padding: 14px 20px;
29
- border: none;
30
- border-radius: 4px;
31
- cursor: pointer;
32
- font-weight: bold;
33
- font-size: 16px;
34
- margin-top: 8px;
35
- }
@@ -1,21 +0,0 @@
1
- <div style="width:80%;left:10%;position:absolute">
2
-
3
- <h1>Main Page</h1>
4
- <h3>Hey there! Welcome to my new Rails app! I'm coding up something pretty cool, so check back soon!</h3>
5
-
6
- <img width="100%" src="http://i.imgur.com/3qtQMoS.png">
7
- <hr>
8
- <h3>FILLER TEXT - PLEASE REPLACE UNLESS YOU LIKE HIPSTER IPSUM</h3>
9
- <p>
10
- Neutra farm-to-table schlitz slow-carb, pinterest pabst helvetica man bun PBR&B deep v salvia small batch brooklyn. Locavore swag artisan single-origin coffee. Neutra selvage waistcoat, pitchfork chia PBR&B thundercats skateboard meditation flannel chillwave organic pinterest. Keffiyeh freegan cray PBR&B mlkshk. Pop-up cronut freegan, cornhole venmo whatever brunch four dollar toast iPhone pitchfork chillwave. Banjo direct trade yr banh mi tacos. Bushwick photo booth next level typewriter squid ugh.
11
- </p>
12
- <p>
13
- Pitchfork letterpress direct trade migas, gochujang chia austin crucifix green juice. Sustainable beard swag, kogi next level wolf hoodie mlkshk ethical thundercats DIY bicycle rights 8-bit gluten-free brooklyn. Narwhal humblebrag +1 keytar cardigan pickled. Synth fixie slow-carb letterpress echo park drinking vinegar. Lo-fi blog pitchfork sartorial, before they sold out bushwick vegan sustainable polaroid lomo kitsch craft beer. Pitchfork vinyl scenester trust fund, ethical food truck slow-carb. Church-key pop-up portland keffiyeh, flannel aesthetic ramps gentrify cronut.
14
- </p>
15
- <p>
16
- Brooklyn pork belly farm-to-table, semiotics YOLO locavore tacos swag franzen hammock stumptown bushwick blue bottle next level. Shoreditch everyday carry pickled, etsy synth typewriter craft beer. Butcher pabst wayfarers, pitchfork kogi vegan chambray. Butcher master cleanse vinyl dreamcatcher, salvia irony 3 wolf moon whatever keffiyeh messenger bag typewriter. Kinfolk dreamcatcher chambray, ethical meggings kickstarter man braid swag seitan flannel fashion axe tilde readymade venmo. Yr pour-over cardigan organic, gastropub quinoa actually jean shorts typewriter bespoke. Selfies XOXO tacos plaid, brooklyn cred schlitz.
17
- </p>
18
- <p>
19
- Truffaut farm-to-table raw denim lumbersexual. Kitsch biodiesel venmo kickstarter. Pour-over kombucha street art tumblr. Jean shorts banh mi flexitarian lo-fi letterpress shabby chic. Fingerstache meditation quinoa farm-to-table, kogi vice whatever etsy. Tousled organic brunch, deep v pour-over literally schlitz bitters mumblecore pug cray next level. Meggings vegan tattooed farm-to-table affogato.
20
- </p>
21
- </div>
@@ -1,25 +0,0 @@
1
- #main-navbar{
2
- height: 25px;
3
- width: 95%;
4
- background-color: black
5
- }
6
- ul#menu {
7
- bottom: -10%;
8
- position: relative;
9
- }
10
-
11
- ul#menu li {
12
- display: inline;
13
- }
14
-
15
- ul#menu li a {
16
- background-color: black;
17
- color: white;
18
- text-decoration: none;
19
- padding: 0px 35px;
20
- font-size: 18px;
21
- }
22
-
23
- ul#menu li a:hover {
24
- background-color: orange;
25
- }
@@ -1,18 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
5
- <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
6
- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
7
- <title>app-name</title>
8
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
9
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
10
- <%= csrf_meta_tags %>
11
- </head>
12
- <body>
13
-
14
- <%= yield %>
15
-
16
- </body>
17
- </html>
18
-
@@ -1,135 +0,0 @@
1
- body {
2
- background-color: #fff;
3
- color: #333;
4
- }
5
-
6
- body, p, ol, ul, td {
7
- font-family: helvetica, verdana, arial, sans-serif;
8
- font-size: 13px;
9
- line-height: 18px;
10
- margin: 33px;
11
- }
12
-
13
- pre {
14
- background-color: #eee;
15
- padding: 10px;
16
- font-size: 11px;
17
- }
18
-
19
- a {
20
- color: #000;
21
- }
22
-
23
- a:visited {
24
- color: #666;
25
- }
26
- a:hover {
27
- color: #fff;
28
- background-color: #000;
29
- }
30
-
31
- table{
32
- border: 1px solid #cccccc;
33
- border-spacing: 0px;
34
- width: 95%;
35
- left: 10%;
36
- }
37
- th {
38
- border-bottom: 1px solid #cccccc;
39
- height: 15px;
40
- }
41
-
42
- td {
43
- padding-bottom: 7px;
44
- padding-left: 5px;
45
- padding-right: 5px;
46
- font-family: helvetica, verdana, arial, sans-serif;
47
- border-left: none;
48
- border-bottom: 1px solid #cccccc;
49
- border-right: 1px solid #cccccc;
50
- vertical-align: top;
51
- font-size: 13px;
52
- color: inherit;
53
- border-top: solid 1px transparent;
54
- white-space: normal;
55
- }
56
-
57
- tr:nth-child(even) {
58
- background: #f2f2f2
59
- }
60
- tr:nth-child(odd) {
61
- background: #FFF
62
- }
63
- tr:hover{
64
- background: rgba(209, 209, 224, 0.5);
65
- }
66
-
67
- div.field,
68
- div.actions {
69
- margin-bottom: 10px;
70
- }
71
-
72
- #notice {
73
- color: green;
74
- }
75
-
76
- .field_with_errors {
77
- padding: 2px;
78
- background-color: red;
79
- display: table;
80
- }
81
-
82
- #error_explanation {
83
- width: 450px;
84
- border: 2px solid red;
85
- padding: 7px;
86
- padding-bottom: 0;
87
- margin-bottom: 20px;
88
- background-color: #f0f0f0;
89
- }
90
-
91
- #error_explanation h2 {
92
- text-align: left;
93
- font-weight: bold;
94
- padding: 5px 5px 5px 15px;
95
- font-size: 12px;
96
- margin: -7px;
97
- margin-bottom: 0;
98
- background-color: #c00;
99
- color: #fff;
100
- }
101
-
102
- #error_explanation ul li {
103
- font-size: 12px;
104
- list-style: square;
105
- }
106
-
107
- label {
108
- display: block;
109
- }
110
- #view-info{
111
- width: 90%;
112
- }
113
- #view-info h2{
114
- top: 0%;
115
- left: 0%;
116
- display: inline-block;
117
- position: relative;
118
- }
119
- #view-info button{
120
- top: 0%;
121
- float: right;
122
- background-color: #3a3a3a;
123
- border-radius: 4px;
124
- border: none;
125
- color: white;
126
- padding: 7px 18px;
127
- display: inline-block;
128
- font-size: 16px;
129
-
130
- }
131
- #view-info a{
132
- color: white;
133
- text-decoration: none;
134
- font-weight: bold;
135
- }
@@ -1,31 +0,0 @@
1
- #signin-bar{
2
- height: 25px;
3
- width: 95%;
4
- background-color: transparent;
5
- color: black;
6
- text-align: right;
7
- padding-right: 5px;
8
- }
9
- #signin-bar a{
10
- text-decoration: none;
11
- color: black;
12
- }
13
- #signin-bar a:hover{
14
- text-decoration: none;
15
- color: white;
16
- }
17
- #blank{
18
- width: 100%;
19
- height: 100%;
20
- opacity: 50%;
21
- background-color: white;
22
- z-index: 999;
23
- position: absolute;
24
- }
25
- #alert{
26
- width:90%;
27
- border:2px solid #000;
28
- z-index: 1000;
29
- position: absolute;
30
- text-align: center;
31
- }
@@ -1,22 +0,0 @@
1
- <h1>Sign In</h1></div>
2
-
3
- <%= form_for @user_session do |f| %>
4
- <%= render 'shared/errors', object: @user_session %>
5
-
6
- <div class="form-group">
7
- <%= f.label :email %>
8
- <%= f.email_field :email, class: 'form-control' %>
9
- </div>
10
-
11
- <div class="form-group">
12
- <%= f.label :password %>
13
- <%= f.password_field :password, class: 'form-control' %>
14
- </div>
15
-
16
- <div class="form-group">
17
- <%= f.label :remember_me %>
18
- <%= f.check_box :remember_me %>
19
- </div>
20
-
21
- <%= f.submit "Log in!", class: 'btn btn-primary btn-lg' %>
22
- <% end %>
@@ -1,22 +0,0 @@
1
- <div class="page-header"><h1>Register</h1></div>
2
-
3
- <%= form_for @user do |f| %>
4
- <%= render 'shared/errors', object: @user %>
5
-
6
- <div class="form-group">
7
- <%= f.label :email %>
8
- <%= f.email_field :email, class: 'form-control' %>
9
- </div>
10
-
11
- <div class="form-group">
12
- <%= f.label :password %>
13
- <%= f.password_field :password, class: 'form-control' %>
14
- </div>
15
-
16
- <div class="form-group">
17
- <%= f.label :password_confirmation %>
18
- <%= f.password_field :password_confirmation, class: 'form-control' %>
19
- </div>
20
-
21
- <%= f.submit 'Register', class: 'btn btn-primary btn-lg' %>
22
- <% end %>
data/lib/rtrain.rb DELETED
@@ -1,2 +0,0 @@
1
- module Rtrain
2
- end
data/rtrain-0.0.1.gem DELETED
Binary file
data/rtrain-0.0.2.gem DELETED
Binary file
data/rtrain-0.0.3.gem DELETED
Binary file
data/rtrain-0.0.4.gem DELETED
Binary file
data/rtrain-0.0.5.gem DELETED
Binary file
data/rtrain-0.0.6.gem DELETED
Binary file
data/rtrain-0.0.7.gem DELETED
Binary file
data/rtrain-0.0.8.gem DELETED
Binary file
data/rtrain-0.0.9.gem DELETED
Binary file
data/rtrain-0.1.0.gem DELETED
Binary file
data/rtrain-0.1.1.gem DELETED
Binary file
data/rtrain-0.1.2.gem DELETED
Binary file
data/rtrain-0.1.3.gem DELETED
Binary file
data/rtrain-0.1.4.gem DELETED
Binary file
data/rtrain-0.1.5.gem DELETED
Binary file
data/rtrain-0.1.6.gem DELETED
Binary file
data/rtrain-0.1.7.gem DELETED
Binary file
data/rtrain-0.1.8.gem DELETED
Binary file
data/rtrain-0.1.9.gem DELETED
Binary file
data/rtrain-0.2.0.gem DELETED
Binary file
data/rtrain-0.2.1.gem DELETED
Binary file
data/rtrain-0.2.2.gem DELETED
Binary file