formie 0.9.16 → 1.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
  SHA256:
3
- metadata.gz: 4bd1c4a0803bfaf95a1d5081a7bd8570f5151a59ab3f405af2b5fbdc1f76e1f2
4
- data.tar.gz: db3e558713bb68bdfe22559aac032ea52f0895bf6b0597e08b1c34b91dd4eb4e
3
+ metadata.gz: f549e073b8de681eddff1ad40c41872f63ed92f69ee365a8425a64438837ed7b
4
+ data.tar.gz: 89061cdce94b4f76ff3c10c2a814a6a7f66e4d2ee88c53364d1f7999c1c54eaf
5
5
  SHA512:
6
- metadata.gz: d1d41acf311878f52e1f7b90518c5518ef99036bc3a828a2d3a1287f5dcdaa56be845d9f3e90e1b1f051bb4f61befca179495a6c4799b7e845c7b466cd6dc905
7
- data.tar.gz: e8f47dfa74a537053611abf009ea0ec908924bae4e1d1ba8c371595f149e827bc7d7258eac8989326f68ea894edb16e0c4bc1e32098e26d4a932fd20bd9c6faa
6
+ metadata.gz: 458c621e7acb2413926cc3070a77edf58d0d96e418e800553ab9f1d5215a7bf89b3af28e0d1ade853ad400945986d64902f403828bcbb0a3dda410b7b5d05846
7
+ data.tar.gz: 02f57fe42549d4e63359b17e2f519d299fd94e0f5216fc30f88101540057fdf4fa2b2315d8062b98c7fc98a6024fad900745fb0643137b29904116e9d8263923
@@ -1 +1 @@
1
- rails-5.2
1
+ rails-6.0
@@ -1 +1 @@
1
- ruby-2.6.1
1
+ ruby-2.6.4
@@ -6,7 +6,9 @@ bundler_args: --without production
6
6
  script: 'bundle exec rake test'
7
7
 
8
8
  rvm:
9
- - 2.6.1
9
+ - 2.6.4
10
+ # - 2.6.3
11
+ # - 2.6.1
10
12
  # - 2.5.1
11
13
  # - 2.5.0
12
14
  # - 2.4.1 # tested
@@ -15,7 +17,8 @@ rvm:
15
17
  # - 2.2.6 # tested
16
18
 
17
19
  gemfile:
18
- - gemfiles/rails_5.2.gemfile
20
+ - gemfiles/rails_6.0.gemfile
21
+ # - gemfiles/rails_5.2.gemfile
19
22
  # - gemfiles/rails_5.1.gemfile
20
23
  # - gemfiles/rails_5.0.gemfile
21
24
 
data/.watchr CHANGED
@@ -16,9 +16,9 @@ end
16
16
 
17
17
  def run_it(type, file)
18
18
  case type
19
- # when 'test'; run %Q{ruby -I"lib:test" -rubygems #{file}}
20
- when 'test'; run %Q{rails test #{file}}
21
- when 'spec'; run %Q{rspec -X #{file}}
19
+ when 'test'; run %Q{ruby -I"lib:test" -r rubygems #{file}}
20
+ # when 'test'; run %Q{rails test #{file}}
21
+ # when 'spec'; run %Q{rspec -X #{file}}
22
22
  else; puts "#{H} unknown type: #{type}, file: #{file}"
23
23
  end
24
24
  end
data/Appraisals CHANGED
@@ -1,3 +1,7 @@
1
+ appraise 'rails-6.0' do
2
+ gem 'rails', '~> 6.0.0'
3
+ end
4
+
1
5
  appraise 'rails-5.2' do
2
6
  gem 'rails', '~> 5.2.0'
3
7
  end
data/Gemfile CHANGED
@@ -6,7 +6,5 @@ gem 'rails'
6
6
  group :test do
7
7
  gem 'observr'
8
8
  gem 'capybara'
9
- gem 'sqlite3', '!= 1.4.0'
10
- # gem 'sqlite3'
11
9
  gem 'slim'
12
10
  end
@@ -1,4 +1,4 @@
1
- Copyright 2012-2018 Dittmar Krall - http://matique.de
1
+ Copyright 2012-2019 Dittmar Krall - http://matique.de
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -4,8 +4,9 @@ Formie
4
4
  [![Gem Version](https://badge.fury.io/rb/formie.svg)](https://badge.fury.io/rb/formie)
5
5
  [![Build Status](https://travis-ci.org/matique/formie.png?branch=master)](https://travis-ci.org/matique/formie)
6
6
 
7
- Tired of programming each HTML tag? Are you in search of DRYness for Rails
8
- views? May be Formie can help you.
7
+ Tired of programming each HTML tag?
8
+ Are you in search of DRYness for Rails views?
9
+ May be Formie can help you.
9
10
 
10
11
  Formie implements low level template-based helpers.
11
12
  It injects the formies into the ActionView module.
@@ -35,9 +36,12 @@ Use 'gem install formie -v 0.7.1' for Rails 3.2.
35
36
 
36
37
  Templates for Formie are hosted in:
37
38
 
38
- - app/formies/forms (bounded to form)
39
- - app/formies/application (free standing)
40
- - app/formies/templates (free standing)
39
+ - <formie_path>/forms (bounded to form)
40
+ - <formie_path>/application (free standing)
41
+ - <formie_path>/templates (free standing)
42
+
43
+ Till Rails 5 <formie_path> is 'app/formies'.
44
+ Starting at Rails 6 <formie_path> is 'app/views/formies'.
41
45
 
42
46
  Inside a formie the following locals (as delivered by the
43
47
  controller) are available:
@@ -75,7 +79,7 @@ To avoid a server restart during development of formies you may add to:
75
79
  <%= f.l_text_field :amount %>
76
80
  <% end %>
77
81
 
78
- In directory app/formies :
82
+ In directory <formie_path> :
79
83
 
80
84
  # application/copyright.html.erb
81
85
  <div class="copyright"> Copyright (c) 2009 </div>
@@ -93,4 +97,8 @@ In directory app/formies :
93
97
  <%= form.text_field field %>
94
98
  </p>
95
99
 
96
- Copyright (c) 2009..2018 Dittmar Krall, released under the MIT license.
100
+ # templates/hello.slim
101
+ span Hello Slim
102
+ # a comment
103
+
104
+ Copyright (c) 2009-2019 Dittmar Krall, released under the MIT license.
data/Rakefile CHANGED
@@ -1,23 +1,6 @@
1
1
  require 'bundler/setup'
2
2
  Bundler::GemHelper.install_tasks
3
3
 
4
-
5
- =begin
6
- ## in particular, make db task available, but in vane
7
- # https://github.com/pat/combustion/issues/13
8
- require "rails"
9
- require "combustion"
10
- require "active_record/railtie"
11
- #Bundler.require :default, Rails.env
12
-
13
-
14
- Bundler.require
15
- #require "combustion"
16
- #Combustion.initialize!
17
- Combustion::Application.load_tasks
18
- =end
19
-
20
-
21
4
  require 'rake/testtask'
22
5
 
23
6
  Rake::TestTask.new(:test) do |t|
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency 'bundler'
27
27
  s.add_development_dependency 'rake', '~> 12'
28
28
  s.add_development_dependency 'appraisal', '~> 2'
29
- s.add_development_dependency 'combustion', '~> 0'
29
+ s.add_development_dependency 'combustion', '~> 1.1'
30
30
 
31
31
  s.add_development_dependency 'minitest'
32
32
  s.add_development_dependency 'simplecov'
@@ -0,0 +1,14 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 6.0.0"
6
+
7
+ group :test do
8
+ gem "observr"
9
+ gem "capybara"
10
+ gem "sqlite3", "!= 1.4.0"
11
+ gem "slim"
12
+ end
13
+
14
+ gemspec path: "../"
@@ -2,12 +2,19 @@ require 'formie/engine.rb'
2
2
 
3
3
  module Formie
4
4
 
5
+ Rails6 = Rails.version.to_f >= 6.0
6
+ PATH = Rails6 ? 'app/views/formies' : 'app/formies'
7
+
5
8
  def self.reload
9
+ if Rails6 && !File.directory?("#{Rails.root}/app/views/formies")
10
+ raise 'Formies must be located in "app/views/formies" since Rails 6'
11
+ end
12
+
6
13
  now = Time.now
7
14
  @last_update ||= Time.new(0)
8
- self.load_formies(::ActionView::Helpers::FormBuilder, 'app/formies/forms')
9
- self.load_formies(::ActionView::Helpers::TextHelper, 'app/formies/application')
10
- self.load_formies(::ActionView::Helpers::TextHelper, 'app/formies/templates')
15
+ self.load_formies(::ActionView::Helpers::FormBuilder, "#{PATH}/forms")
16
+ self.load_formies(::ActionView::Helpers::TextHelper, "#{PATH}/application")
17
+ self.load_formies(::ActionView::Helpers::TextHelper, "#{PATH}/templates")
11
18
  @last_update = now
12
19
  end
13
20
 
@@ -18,7 +25,11 @@ module Formie
18
25
  #p "** called #{where} #{formiename}", args, block
19
26
  params = args.extract_options!
20
27
  options = {}
21
- options[:file] = path
28
+ unless Rails6
29
+ options[:file] = path
30
+ else
31
+ options[:template] = path.sub("#{Rails.root}/app/views", "")
32
+ end
22
33
  options[:locals] = {}
23
34
  options[:locals].update params
24
35
  options[:locals].update :formiename => formiename,
@@ -1,5 +1,6 @@
1
1
  module Formie
2
- VERSION = '0.9.16' # 2019-03-05
2
+ VERSION = '1.0.0' # 2019-09-26
3
+ # VERSION = '0.9.16' # 2019-03-05
3
4
  # VERSION = '0.9.15' # 2019-03-02
4
5
  # VERSION = '0.9.14' # 2019-03-02
5
6
  # VERSION = '0.9.13'
@@ -23,6 +23,13 @@ describe "Formie" do
23
23
  assert_equal 'Hello Slim', page.find('form span').text
24
24
  end
25
25
 
26
+ it 'should remove comments in Slim testing full stack' do
27
+ order = Order.all.first
28
+
29
+ visit "/orders/#{order.id}"
30
+ refute page.has_content?("a comment")
31
+ end
32
+
26
33
  it 'builtins' do
27
34
  visit "/orders/new"
28
35
  assert page.has_content?("action_name new")
@@ -1 +1,3 @@
1
+ / a comment
2
+
1
3
  span Hello Slim
@@ -0,0 +1,3 @@
1
+ <% year ||= args.first || Time.now.year %>
2
+
3
+ <div class="copyright"> Copyright (c) <%= year %> </div>
@@ -0,0 +1,7 @@
1
+ action_name <%= action_name %> <br/>
2
+ args <%= args %> <br/>
3
+ block <%= block.call(3) %> <br/>
4
+ controller_name <%= controller_name %> <br/>
5
+ form <%= form.class.name %> <br/>
6
+ form.object <%= form.object.class.name %> <br/>
7
+ params <%= params[:action] %> <br/>
@@ -0,0 +1,4 @@
1
+ <p>
2
+ <%= form.label args.first %><br />
3
+ <%= form.text_field args.first %>
4
+ </p>
@@ -0,0 +1,3 @@
1
+ / a comment
2
+
3
+ span Hello Slim
@@ -0,0 +1,2 @@
1
+ <% field = args.first %>
2
+ <%= labelled field, text_field_tag(field) %>
@@ -0,0 +1,4 @@
1
+ <p>
2
+ <label> <%= args[0] %> </label>
3
+ <%= args[1] %>
4
+ </p>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.16
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-05 00:00:00.000000000 Z
11
+ date: 2019-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '1.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '1.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -136,6 +136,7 @@ files:
136
136
  - gemfiles/rails_5.0.gemfile
137
137
  - gemfiles/rails_5.1.gemfile
138
138
  - gemfiles/rails_5.2.gemfile
139
+ - gemfiles/rails_6.0.gemfile
139
140
  - lib/formie.rb
140
141
  - lib/formie/engine.rb
141
142
  - lib/formie/version.rb
@@ -151,6 +152,12 @@ files:
151
152
  - test/internal/app/formies/templates/labelled.html.erb
152
153
  - test/internal/app/models/application_record.rb
153
154
  - test/internal/app/models/order.rb
155
+ - test/internal/app/views/formies/application/copyright.html.erb
156
+ - test/internal/app/views/formies/forms/builtins.html.erb
157
+ - test/internal/app/views/formies/forms/l_text_field.html.erb
158
+ - test/internal/app/views/formies/templates/hello.slim
159
+ - test/internal/app/views/formies/templates/l_text_field.html.erb
160
+ - test/internal/app/views/formies/templates/labelled.html.erb
154
161
  - test/internal/app/views/layouts/application.html.erb
155
162
  - test/internal/app/views/orders/_form.html.erb
156
163
  - test/internal/app/views/orders/_new.html.erb
@@ -182,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
189
  - !ruby/object:Gem::Version
183
190
  version: '0'
184
191
  requirements: []
185
- rubygems_version: 3.0.1
192
+ rubygems_version: 3.0.6
186
193
  signing_key:
187
194
  specification_version: 4
188
195
  summary: Formie is like a Rails helper, but uses the notation of a partial.
@@ -199,6 +206,12 @@ test_files:
199
206
  - test/internal/app/formies/templates/labelled.html.erb
200
207
  - test/internal/app/models/application_record.rb
201
208
  - test/internal/app/models/order.rb
209
+ - test/internal/app/views/formies/application/copyright.html.erb
210
+ - test/internal/app/views/formies/forms/builtins.html.erb
211
+ - test/internal/app/views/formies/forms/l_text_field.html.erb
212
+ - test/internal/app/views/formies/templates/hello.slim
213
+ - test/internal/app/views/formies/templates/l_text_field.html.erb
214
+ - test/internal/app/views/formies/templates/labelled.html.erb
202
215
  - test/internal/app/views/layouts/application.html.erb
203
216
  - test/internal/app/views/orders/_form.html.erb
204
217
  - test/internal/app/views/orders/_new.html.erb