inline_forms 7.9.6 → 7.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +68 -0
  3. data/Rakefile +18 -1
  4. data/app/assets/javascripts/inline_forms/inline_forms.js +53 -34
  5. data/app/helpers/form_elements/date.rb +0 -1
  6. data/app/helpers/form_elements/month_year_picker.rb +1 -15
  7. data/app/helpers/form_elements/time.rb +0 -1
  8. data/docs/jquery-widgets.md +25 -0
  9. data/docs/prompt/test-the-example-app.md +3 -3
  10. data/docs/turbo-stream-audit.md +16 -0
  11. data/docs/ujs-to-turbo.md +15 -0
  12. data/inline_forms.gemspec +6 -21
  13. data/lib/inline_forms/gem_files.rb +39 -0
  14. data/lib/inline_forms/version.rb +1 -1
  15. metadata +18 -81
  16. data/bin/inline_forms +0 -141
  17. data/bin/inline_forms_app_template.rb +0 -22
  18. data/bin/inline_forms_installer_core.rb +0 -874
  19. data/lib/generators/templates/capistrano/Capfile +0 -39
  20. data/lib/generators/templates/capistrano/deploy.rb +0 -59
  21. data/lib/generators/templates/capistrano/production.rb +0 -7
  22. data/lib/generators/templates/unicorn/production.rb +0 -39
  23. data/lib/installer_templates/dartsass/devise_main.scss +0 -2
  24. data/lib/installer_templates/dartsass/inline_forms_dartsass_builds.rb +0 -14
  25. data/lib/installer_templates/dartsass/inline_forms_main.scss +0 -2
  26. data/lib/installer_templates/example_app_tests/test/example_app/example_integration_test_case.rb +0 -36
  27. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_field_turbo_test.rb +0 -73
  28. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_name_list_test.rb +0 -73
  29. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_name_required_test.rb +0 -21
  30. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_photos_pagination_test.rb +0 -440
  31. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_row_turbo_test.rb +0 -103
  32. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_top_level_new_test.rb +0 -70
  33. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_top_level_pagination_test.rb +0 -40
  34. data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_versions_turbo_test.rb +0 -120
  35. data/lib/installer_templates/example_app_tests/test/integration/example_app_guest_access_test.rb +0 -21
  36. data/lib/installer_templates/example_app_tests/test/integration/example_app_photo_revert_test.rb +0 -94
  37. data/lib/installer_templates/example_app_tests/test/integration/example_app_photos_test.rb +0 -22
  38. data/lib/installer_templates/example_app_tests/test/integration/example_app_routing_test.rb +0 -15
  39. data/lib/installer_templates/example_app_tests/test/integration/example_app_turbo_layout_test.rb +0 -25
  40. data/lib/installer_templates/example_app_tests/test/integration/example_app_validation_hints_test.rb +0 -40
  41. data/lib/installer_templates/example_app_tests/test/models/example_app_apartment_name_validation_test.rb +0 -16
  42. data/lib/installer_templates/example_app_tests/test/models/example_app_apartment_photo_test.rb +0 -26
  43. data/lib/installer_templates/example_app_tests/test/models/example_app_paper_trail_changeset_test.rb +0 -78
  44. data/lib/installer_templates/example_app_tests/test/models/example_app_plain_text_rich_text_edge_cases_test.rb +0 -46
  45. data/lib/installer_templates/example_app_views/apartments/name_list.html.erb +0 -26
  46. data/lib/installer_templates/example_app_views/inline_forms/_header.html.erb +0 -45
data/bin/inline_forms DELETED
@@ -1,141 +0,0 @@
1
- #!/usr/bin/env ruby
2
- module InlineForms
3
- require File.join(File.dirname(__FILE__), "../lib/inline_forms/version.rb")
4
- require 'securerandom'
5
-
6
- # what is this?
7
- Signal.trap("INT") { puts; exit }
8
-
9
- require 'thor'
10
- class Creator < Thor
11
- include Thor::Actions
12
-
13
- def self.source_root
14
- File.dirname(__FILE__)+"/.."
15
- end
16
- desc "create APP", "create an application with inline_forms v#{VERSION}"
17
- DATABASE_OPTIONS = %w(sqlite mysql)
18
- method_option :database, :aliases => "-d", :banner => DATABASE_OPTIONS.join('|'), :desc => 'specify development database'
19
- method_option :example, :type => :boolean, :desc => 'install the example app. uses sqlite as development database'
20
- method_option :email, :aliases => "-e", :default => "admin@example.com", :desc => 'specify admin email'
21
- method_option :password, :aliases => "-p", :default => "admin999", :desc => 'specify admin password'
22
- method_option :runtest, :aliases => "\-\-run-test", :default => false, :desc => 'run tests'
23
- method_option :skiprvm, :aliases => "\-\-no-rvm", :type => :boolean, :default => false, :desc => 'install inline_forms without RVM'
24
-
25
- def create(app_name)
26
- def self.skiprvm
27
- options[:skiprvm]
28
- end
29
-
30
- def self.runtest
31
- options[:runtest]
32
- end
33
-
34
- def self.install_example?
35
- options[:example]
36
- end
37
-
38
- def self.database
39
- @database ||= options[:database]
40
- return @database if DATABASE_OPTIONS.include?(@database)
41
- say "No Database specified please choose one database #{DATABASE_OPTIONS.join(' | ')}", :red
42
- # if the database is not set ask user which database to use
43
- while ! DATABASE_OPTIONS.include?(@database)
44
- @database = ask "Database: "
45
- return @database if DATABASE_OPTIONS.include?(@database)
46
- end
47
- end
48
-
49
- def self.using_sqlite?
50
- database == 'sqlite'
51
- end
52
-
53
- def self.email
54
- options[:email]
55
- end
56
-
57
- def self.password
58
- options[:password]
59
- end
60
-
61
- if install_example? && !using_sqlite?
62
- say "--example can only be used with an sqlite development database", :red
63
- exit 1
64
- end
65
-
66
- say "Creating #{app_name} with inline_forms v#{VERSION} and development database #{database}...", :green
67
-
68
- regex = /\A[0-9a-zA-Z][0-9a-zA-Z_-]+[0-9a-zA-Z]\Z/
69
- if ! regex.match(app_name)
70
- say "Error: APP must match #{regex.source}", :red
71
- exit 1
72
- end
73
-
74
- if File.exist?(app_name)
75
- say "Error: APP exists", :red
76
- exit 1
77
- end
78
-
79
- require 'rvm'
80
- # if RVM is detected and the user has not disabled using rvm via command than use rvm else without
81
- if RVM.current && !options[:skiprvm]
82
- # Let the user know that he are installing the inline_forms with support of RVM
83
- say "Installing inline_forms with RVM", :green
84
- # which ruby version is currently activated?
85
- ruby_version = (%x[rvm current]).gsub(/@.*/,'')
86
- # Create a ruby rvm-file version based on the version detected
87
- create_file "#{app_name}/.ruby-version", ruby_version
88
- # Creat a ruby-gemset rvm-file based on the version detected
89
- create_file "#{app_name}/.ruby-gemset", app_name
90
- else
91
- # Let the user know that he is installing inline_forms without RVM
92
- say "Installing inline_forms without RVM", :green
93
- end
94
-
95
- say "Installing with #{options[:database]}", :green
96
-
97
- # Creates the app directory
98
- empty_directory(app_name)
99
-
100
- # puts all options in environment to app_template
101
- options.each do | k,v |
102
- ENV[k] = v.to_s
103
- end
104
-
105
- ENV['using_sqlite'] = using_sqlite?.to_s
106
- ENV['database'] = database
107
- ENV['install_example'] = install_example?.to_s
108
- ENV['ruby_version'] = ruby_version
109
- ENV['inline_forms_version'] = VERSION
110
-
111
- app_template_file = File.join(File.dirname(__FILE__), 'inline_forms_app_template.rb')
112
-
113
- # Prefer a Rails 7.0.x generator when one is installed locally: the
114
- # generated `Gemfile`/`config/application.rb` pin to `rails ~> 7.0.0`,
115
- # so running `rails new` from a newer system Rails (e.g. 8.0.x) emits
116
- # 7.1+/8.0-only configuration (`load_defaults 8.0`,
117
- # `config.autoload_lib(...)`) that aborts on the next `bundle exec`.
118
- # The installer_core also patches `config/application.rb` defensively;
119
- # the explicit version selector is the cleaner first line of defense.
120
- require 'rubygems'
121
- compatible_rails =
122
- begin
123
- Gem::Specification
124
- .find_all_by_name("rails")
125
- .map(&:version)
126
- .select { |v| v >= Gem::Version.new("7.0") && v < Gem::Version.new("7.1") }
127
- .max
128
- rescue StandardError
129
- nil
130
- end
131
- rails_invocation = compatible_rails ? "rails _#{compatible_rails}_" : "rails"
132
- say "Generating app with: #{rails_invocation} new ...", :green
133
-
134
- if ! run("#{rails_invocation} new #{app_name} -m #{app_template_file} --skip-bundle --skip-bootsnap --javascript=importmap")
135
- say "Rails could not create the app '#{app_name}', maybe because it is a reserved word...", :red # TODO ROYTJE MAKE ERROR MESSAGE MORE RELEVANT # Rails could not create the app 'MyApp', maybe because it is a reserved word..
136
- exit 1
137
- end
138
- end
139
- Creator.start
140
- end
141
- end
@@ -1,22 +0,0 @@
1
- require 'rvm'
2
-
3
- if RVM.current && ENV['skiprvm'] !='true'
4
- rvm_version = "#{ENV['ruby_version']}@#{app_name}"
5
- # Rails' `app_name` is underscored (e.g. my_app) while the directory may be
6
- # camel-cased (MyApp); `../#{app_name}` breaks on case-sensitive filesystems.
7
- RVM.chdir(File.expand_path(".")) do
8
- say "Working directory is #{`pwd`}"
9
- RVM.use_from_path! '.' # TODO ROYTJE FIX THIS BELOW
10
- # Warning! PATH is not properly set up, '/home/vagrant/.rvm/gems/ruby-2.0.0-p247@MyApp/bin' is not available,
11
- # usually this is caused by shell initialization files - check them for 'PATH=...' entries,
12
- # it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
13
- # to fix temporarily in this shell session run: 'rvm use ruby-2.0.0-p247@MyApp'.
14
- rvm_gemset = %x[rvm current]
15
- say "RVM GEMSET is now #{rvm_gemset}"
16
- say "Installing using gemset : #{RVM.current.environment_name}", :green
17
- end
18
- else
19
- say "Installing without RVM", :green
20
- end
21
-
22
- apply(File.join(File.dirname(__FILE__), 'inline_forms_installer_core.rb'))