r5 0.4.0.5 → 0.5.0.0

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: 99e51a305bbe68045557d44fc95cef0cf139b41c
4
- data.tar.gz: 16f5fe3d847c194b03a532f77a219bef1ba41e99
3
+ metadata.gz: e9844737f65bfd08394e29d9bf930e609c7c08b5
4
+ data.tar.gz: d83246c42147ce6cf5e5b2c5c515b0a3cbe67c28
5
5
  SHA512:
6
- metadata.gz: 1afc1d4340b94b766d31b70d41e7d70a492fb30a3125dc751ad6664dc9eb8a9d8d21d68573c214f33881b6efeef137cc8dd17d2aab511ac775cb692ced7a0ec1
7
- data.tar.gz: 0b10759baabd02fe5be00cfe608a76e78ff8ef96af131d0f017e3cbc789d13d2b0f9914a50ecf0d2bc9b21653bb4a6ee2873f7577e444646af08c37a3202e33a
6
+ metadata.gz: eac970f627638122800a615eca0d3caeb0bbb1e053acb9ccb544ef71764ddf494bffdce118ba5311892464bda8121620fad7ba0e06b02360549030a199906095
7
+ data.tar.gz: 7bcf153616f3391cc96594d192644c2e9a6575ee3f3845fee585307e1705952d0cacc13a5f3e25a31dc9af9929dbbbb89136fd17bb42e54ac3be3474588bdf64
@@ -1,17 +1,17 @@
1
1
  # DEFAULT SETTINGS
2
- copy '.ruby-version'
3
- gsub_file "#{@project_path}/.ruby-version", /version/, RUBY_VERSION
2
+
3
+ # gsub_file "#{@project_path}/.ruby-version", /version/, RUBY_VERSION
4
4
  apply 'recipes/gemfile.rb'
5
5
  run 'bundle install'
6
6
 
7
+ # run 'bundle exec rails webpacker:install'
8
+ # system "yarn add @rails/webpacker@4.0.0-pre.2"
9
+ # system "yarn add webpack-cli -D"
10
+
7
11
  copy 'config/initializers/html_helpers.rb'
8
12
  copy 'config/locales/cs.yml'
9
- # copy 'app/assets/stylesheets/theme.css'
10
- # copy 'app/assets/stylesheets/custom.css.scss'
11
- # copy 'app/assets/stylesheets/timepress.css.scss'
12
- # only for bootstrap
13
- #copy 'app/assets/stylesheets/bootstrap-variables.scss'
14
- #copy 'app/assets/stylesheets/bootstrap-generators.scss'
13
+ copy 'app/assets/javascripts/custom.js'
14
+ copy 'app/assets/stylesheets/custom.css.scss'
15
15
 
16
16
  apply 'recipes/bootstrap_app.rb'
17
17
  apply 'recipes/upload_app.rb'
@@ -42,6 +42,7 @@ apply 'recipes/timepress_specifics.rb'
42
42
  apply 'recipes/add_rack_mini_profiler.rb'
43
43
  gsub_file layout_file, 'PROJECT_NAME', @project_name
44
44
  apply 'recipes/gitignore.rb'
45
+ #copy '.ruby-version'
45
46
  run 'git init'
46
47
  run 'git add .'
47
48
  run "git commit -a -m 'Initial commit'"
@@ -7,7 +7,7 @@ run 'rails g devise:install'
7
7
  run 'rails g devise User'
8
8
 
9
9
  insert_into_file "#{@project_path}/app/controllers/application_controller.rb",
10
- after: "protect_from_forgery with: :exception\n" do <<-RUBY
10
+ after: "class ApplicationController < ActionController::Base\n" do <<-RUBY
11
11
  before_action :configure_permitted_parameters, if: :devise_controller?
12
12
  before_action :authenticate_user!
13
13
 
@@ -4,7 +4,7 @@ gsub_file gemfile, "gem 'sqlite3'", "gem 'mysql2'"
4
4
  insert_into_file gemfile, after: "group :development, :test do\n" do
5
5
  <<EOF
6
6
  gem 'rspec-rails'
7
- gem 'factory_girl_rails'
7
+ gem 'factory_bot'
8
8
  gem 'timecop'
9
9
  gem 'guard-rspec'
10
10
  gem 'spring-commands-rspec'
@@ -34,6 +34,8 @@ end
34
34
 
35
35
  # make content_tag temporarily available
36
36
  gem 'record_tag_helper', '~> 1.0'
37
+ gem "jquery-rails"
38
+ # gem 'webpacker', '>= 4.0.x'
37
39
  EOF
38
40
  end
39
41
 
@@ -1,73 +1,26 @@
1
- add_gem 'materialize-sass'
1
+ add_gem 'materialize-sass', "~> 1.0.0.rc1"
2
2
  add_gem 'material_icons'
3
3
 
4
4
  run 'bundle install'
5
+ # system "yarn add jquery moment snackbarjs"
5
6
 
6
- system "yarn add jquery moment"
7
+ remove_file "#{@project_path}/app/assets/stylesheets/application.css"
7
8
 
8
- insert_into_file "#{@project_path}/app/assets/stylesheets/application.css",
9
- before: "\n *= require_tree ." do <<-TXT
10
-
11
- *= require materialize
12
- *= require material_icons
9
+ create_file "#{@project_path}/app/assets/stylesheets/application.scss" do <<-TXT
10
+ @import "materialize/components/color-variables";
11
+ $primary-color: color("grey", "base") !default;
12
+ $secondary-color: color("green", "base") !default;
13
+ $link-color: color("green", "base") !default;
14
+ @import "materialize";
15
+ @import "material_icons";
13
16
  TXT
14
17
  end
15
18
 
19
+
16
20
  insert_into_file "#{@project_path}/app/assets/javascripts/application.js",
17
21
  before: "\n//= require_tree ." do <<-TXT
18
-
19
- //= require materialize-sprockets
22
+ \n
23
+ //= require materialize
24
+ //= require jquery
20
25
  TXT
21
26
  end
22
-
23
- create_file "#{@project_path}/config/webpack/custom.js" do <<-JS
24
- const webpack = require('webpack')
25
-
26
- module.exports = {
27
- resolve: {
28
- alias: {
29
- jquery: 'jquery/src/jquery',
30
- }
31
- },
32
- }
33
-
34
- // config/webpack/development.js
35
- const merge = require('webpack-merge')
36
- const environment = require('./environment')
37
- const customConfig = require('./custom')
38
-
39
- module.exports = merge(environment.toWebpackConfig(), customConfig)
40
- JS
41
- end
42
-
43
- insert_into_file "#{@project_path}/app/javascript/packs/application.js",
44
- after: "console.log('Hello World from Webpacker')" do <<-JS
45
-
46
- import jQuery from 'jquery'
47
- window.jQuery = jQuery
48
-
49
- let ready;
50
- ready = function() {
51
- // $(".datepicker").datetimepicker({locale: 'cs', format: 'D. M. YYYY'});
52
- };
53
- // Fire javascript after turbolinks event
54
- $(document).on('turbolinks:load', ready);
55
- JS
56
- end
57
-
58
- insert_into_file "#{@project_path}/config/webpack/environment.js",
59
- after: "const { environment } = require('@rails/webpacker')" do <<-JS
60
-
61
- const webpack = require('webpack')
62
-
63
- // Add an additional plugin of your choosing : ProvidePlugin
64
- environment.plugins.set(
65
- 'Provide',
66
- new webpack.ProvidePlugin({
67
- $: 'jquery',
68
- jQuery: 'jquery',
69
- jquery: 'jquery',
70
- })
71
- )
72
- JS
73
- end
@@ -13,8 +13,8 @@ class Starter < Thor
13
13
  create_config_file
14
14
  end
15
15
 
16
- if (system "rails -v").nil? or (%x[rails -v] =~ /Rails 5.1.*/).nil?
17
- say "You didn't install Rails or have version lower than 5.1 Please install proper version.", :red
16
+ if (system "rails -v").nil? or (%x[rails -v] =~ /Rails 5.2.*/).nil?
17
+ say "You didn't install Rails or have version lower than 5.2 Please install proper version.", :red
18
18
  abort
19
19
  end
20
20
 
@@ -58,8 +58,7 @@ class Starter < Thor
58
58
  method_options type: :string
59
59
  def new project_name
60
60
  @project_name = project_name
61
- run "rails new #{@project_name} -T --skip-bundle --webpack"
62
- #run 'rake webpacker:install'
61
+ run "rails new #{@project_name} -T --skip-bundle"
63
62
 
64
63
  @project_path = "#{@dir}/#{@project_name}"
65
64
  @project_label = @project_name.capitalize.gsub('_', ' ')
@@ -73,9 +72,9 @@ class Starter < Thor
73
72
  apply "installations/#{options[:type]}.rb"
74
73
  end
75
74
 
76
- run 'gem install foreman'
77
- copy 'Procfile'
78
- say 'Start your application with foreman start', :green
75
+ # run 'gem install foreman'
76
+ # copy 'Procfile'
77
+ say 'Start your application with rails s', :green
79
78
  end
80
79
 
81
80
  desc 'add_timepress_specifics', 'add datepicker and other timepress specific things'
@@ -174,9 +173,9 @@ class Starter < Thor
174
173
  remove_file "#{@project_path}/#{filename}"
175
174
  end
176
175
 
177
- def add_gem name
176
+ def add_gem name, version=""
178
177
  append_to_file "#{@project_path}/Gemfile" do
179
- "\ngem '#{name}'"
178
+ version == "" ? "\ngem '#{name}'" : "\ngem '#{name}', '#{version}'"
180
179
  end
181
180
  end
182
181
 
@@ -0,0 +1,10 @@
1
+ var ready;
2
+ ready = function() {
3
+ M.AutoInit();
4
+ $.each( flashMessages, function(key, value){
5
+ M.toast({html: value, classes: key})
6
+ });
7
+ };
8
+
9
+ // Fire javascript after turbolinks event
10
+ $(document).on('turbolinks:load', ready);
@@ -125,4 +125,15 @@ table.table.table-striped tr.highlight_row td {
125
125
  /* 4px */
126
126
  }
127
127
 
128
+ .snackbar.error {
129
+ //background-color: red;
130
+ }
131
+ .snackbar.alert {
132
+ //background-color: yellow;
133
+ //color: black;
134
+ }
135
+ .snackbar.notice {
136
+ //background-color: green;
137
+ }
138
+
128
139
 
@@ -12,9 +12,8 @@
12
12
  <%= javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js", "https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js" %>
13
13
  <![endif]-->
14
14
 
15
- <%= javascript_pack_tag 'application' %>
16
- <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
17
- <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
15
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
16
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
18
17
  <%= csrf_meta_tags %>
19
18
  </head>
20
19
  <body>
@@ -30,7 +29,7 @@
30
29
  <a href="#" class="brand-logo right">Logo</a>
31
30
  <ul id="nav-mobile" class="hide-on-med-and-down">
32
31
  <%= menu_item 'example', '#', /example(?!new)/ %>
33
- <li><a class="dropdown-button" href="#!" data-activates="user-details">
32
+ <li><a class="dropdown-trigger" href="#!" data-target="user-details">
34
33
  Přihlášen: <%= current_user.display_name %><i class="material-icons right">arrow_drop_down</i>
35
34
  </a>
36
35
  </li>
@@ -38,16 +37,13 @@
38
37
  </div>
39
38
  </nav>
40
39
  <% end %>
41
-
42
- <div class="container container-large content">
43
- <% flash.each do |name, msg| %>
44
- <%= content_tag :div, :class => "alert alert-#{ name == :error ? "danger" : "success" } alert-dismissable" do %>
45
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
46
- <%= msg %>
47
- <% end %>
48
- <% end %>
49
40
 
41
+ <div class="container container-large content">
50
42
  <%= yield %>
51
43
  </div>
44
+
45
+ <%= javascript_tag do %>
46
+ window.flashMessages = $.parseJSON('<%=j flash.to_hash.to_json.html_safe %>');
47
+ <% end %>
52
48
  </body>
53
49
  </html>
@@ -1,3 +1,3 @@
1
1
  module R5
2
- VERSION = "0.4.0.5"
2
+ VERSION = "0.5.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.5
4
+ version: 0.5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mousse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2018-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,6 +99,7 @@ files:
99
99
  - lib/r5/template/app/assets/fonts/glyphicons-halflings-regular.ttf
100
100
  - lib/r5/template/app/assets/fonts/glyphicons-halflings-regular.woff
101
101
  - lib/r5/template/app/assets/fonts/glyphicons-halflings-regular.woff2
102
+ - lib/r5/template/app/assets/javascripts/custom.js
102
103
  - lib/r5/template/app/assets/javascripts/main.js.rb
103
104
  - lib/r5/template/app/assets/stylesheets/bootstrap-generators.scss
104
105
  - lib/r5/template/app/assets/stylesheets/bootstrap-variables.scss
@@ -154,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  version: '0'
155
156
  requirements: []
156
157
  rubyforge_project:
157
- rubygems_version: 2.6.11
158
+ rubygems_version: 2.5.2
158
159
  signing_key:
159
160
  specification_version: 4
160
161
  summary: Rails generator using Thor gem for private usage mostly