r5 0.2.5 → 0.2.5.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: 30d34640d64b9724b651caf8ac499e786738db0b
4
- data.tar.gz: 191decc6eed0211de6617b5f0065350201f32439
3
+ metadata.gz: 26550595f90b7f41ecbdbdf365551a9425e0ad78
4
+ data.tar.gz: 2955c93cfea238c2fa006341ea2c900240376196
5
5
  SHA512:
6
- metadata.gz: f4afb240095af0c1f6e644dced6bd6d82552b330a28c026dd79dffcad50316722703cb2550237d8c49bf853c223f058653aabcf744ed28638ebf34f4cb5b60e9
7
- data.tar.gz: fcad3de34a8381392eda0aacd7ce62c5a47912e6b857c5fe5f11024c021aa51284015bad239900259e117fc417f45ebb2aa63456e972a8dc6f8fc88950a3ffa9
6
+ metadata.gz: c4f4c5f4ad3cd380971df462adb4d96c8d53f2c1e62fde59177bb181919c5b2ac23aede0c24d3ca11efb683d5aa9f3ccf9f93e46c5012cbde3ce456977ba3664
7
+ data.tar.gz: 452d9a2be352275440e8a0b4a1f4cd873c9c9cf35cca38402559f06fbbc743c690df890f9c9711995fe69e77db17ae6930914b1a8383874796029e5579209ad2
@@ -41,6 +41,7 @@ remove 'app/views/layouts/application.html.erb'
41
41
  copy 'app/views/layouts/application.html.erb'
42
42
  apply 'recipes/mail_settings.rb'
43
43
  apply 'recipes/timepress_specifics.rb'
44
+ apply 'recipes/add_rack_mini_profiler.rb'
44
45
  gsub_file layout_file, 'PROJECT_NAME', @project_name
45
46
  apply 'recipes/gitignore.rb'
46
47
  run 'git init'
@@ -0,0 +1,6 @@
1
+ if check_gem_existence 'rack-mini-profiler'
2
+ say 'It seems you have already installed rack-mini-profiler gem, check your gemfile', :red
3
+ else
4
+ add_gem 'rack-mini-profiler'
5
+ run 'bundle install'
6
+ end
@@ -18,6 +18,8 @@ insert_into_file gemfile, after: "group :development do\n" do
18
18
  gem 'binding_of_caller'
19
19
  gem 'meta_request'
20
20
  gem 'bullet'
21
+ gem 'pry'
22
+ gem 'pry-byebug'
21
23
  EOF
22
24
  end
23
25
 
@@ -7,7 +7,32 @@ add_gem 'wkhtmltopdf-binary'
7
7
  run 'bundle install'
8
8
  run 'rails generate wicked_pdf'
9
9
 
10
- say "CHECK https://github.com/mileszs/wicked_pdf", :green
10
+ instructions = <<-TXT
11
+ INSTRUCTIONS:
12
+ Quick test: add 'render pdf: "file_name"' to your controller action
13
+ (show action is usually the easiest bet) )
14
+
15
+ More advanced example:
16
+ footer_html = render_to_string('offers/footer.html.erb', layout: 'layouts/pdf.html')
17
+ header_html = render_to_string('offers/header.html.erb', layout: 'layouts/pdf.html')
18
+ body_html = render_to_string('offers/print.html.erb', layout: 'layouts/pdf.html')
19
+
20
+ pdf = WickedPdf.new.pdf_from_string(
21
+ body_html,
22
+ header: {content: header_html, spacing: 5},
23
+ footer: {content: footer_html},
24
+ page_size: 'A4',
25
+ margin: {top: 25, bottom: 45, left: 10, right: 10},
26
+
27
+ )
28
+ send_data pdf, filename: "offer_number.pdf",
29
+ type: 'application/pdf',
30
+ disposition: 'inline'
31
+
32
+ FOR MORE INFORMATION: https://github.com/mileszs/wicked_pdf
33
+ TXT
34
+
35
+ say instructions, :green
11
36
  say "For server - find binary with which wkhtmltopdf and used it as exe_path in config/initializers/wicked_pdf.rb", :red
12
37
 
13
38
 
@@ -68,6 +68,11 @@ class Starter < Thor
68
68
  apply 'recipes/timepress_specifics.rb'
69
69
  end
70
70
 
71
+ desc 'add_rack_mini_profiler', 'add profiling tool to help you keep an eye on performance'
72
+ def add_rack_mini_profiler
73
+ apply 'recipes/add_rack_mini_profiler.rb'
74
+ end
75
+
71
76
  desc 'add_wicked_pdf', 'add pdf generation to project'
72
77
  def add_wicked_pdf
73
78
  apply 'recipes/wicked_pdf.rb'
@@ -158,6 +163,10 @@ class Starter < Thor
158
163
  "\ngem '#{name}'"
159
164
  end
160
165
  end
166
+
167
+ def check_gem_existence name
168
+ File.read("#{@project_path}/Gemfile") =~ /#{name}/
169
+ end
161
170
  end
162
171
 
163
172
  end
@@ -1,3 +1,3 @@
1
1
  module R5
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.5.2"
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.2.5
4
+ version: 0.2.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mousse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-01 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,6 +73,7 @@ files:
73
73
  - lib/r5/installations/default.rb
74
74
  - lib/r5/installations/testing.rb
75
75
  - lib/r5/odin.rb
76
+ - lib/r5/recipes/add_rack_mini_profiler.rb
76
77
  - lib/r5/recipes/bootstrap.rb
77
78
  - lib/r5/recipes/bootstrap_app.rb
78
79
  - lib/r5/recipes/devise.rb