decko 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/decko.rb +0 -15
  3. data/lib/decko/application.rb +1 -6
  4. data/lib/decko/commands/application.rb +2 -2
  5. data/lib/decko/commands/cucumber_command.rb +4 -7
  6. data/lib/decko/commands/rspec_command.rb +4 -6
  7. data/lib/decko/commands/rspec_command/parser.rb +1 -1
  8. data/lib/decko/config/environments/cypress.rb +0 -2
  9. data/lib/decko/config/environments/development.rb +9 -18
  10. data/lib/decko/config/environments/test.rb +0 -7
  11. data/lib/decko/engine.rb +0 -1
  12. data/lib/decko/generators/{decko → deck}/USAGE +0 -0
  13. data/lib/decko/generators/deck/deck_generator.rb +132 -0
  14. data/lib/decko/generators/deck/deck_generator/deck_helper.rb +110 -0
  15. data/lib/decko/generators/deck/deck_generator/interactive.rb +120 -0
  16. data/lib/decko/generators/deck/deck_generator/rails_overrides.rb +54 -0
  17. data/lib/decko/generators/deck/templates/Gemfile.erb +56 -0
  18. data/lib/decko/generators/{decko/templates/Rakefile → deck/templates/Rakefile.erb} +0 -0
  19. data/lib/decko/generators/{decko/templates/bin/spring → deck/templates/bin/spring.erb} +3 -1
  20. data/lib/decko/generators/{decko/templates/config.ru → deck/templates/config.ru.erb} +0 -0
  21. data/lib/decko/generators/{decko/templates/config/application.rb → deck/templates/config/application.rb.erb} +38 -17
  22. data/lib/decko/generators/{decko/templates/config/boot.rb → deck/templates/config/boot.rb.erb} +1 -5
  23. data/lib/decko/generators/deck/templates/config/cucumber.yml +1 -0
  24. data/lib/decko/generators/{decko → deck}/templates/config/databases/frontbase.yml +0 -0
  25. data/lib/decko/generators/{decko → deck}/templates/config/databases/ibm_db.yml +0 -0
  26. data/lib/decko/generators/{decko → deck}/templates/config/databases/jdbc.yml +0 -0
  27. data/lib/decko/generators/{decko → deck}/templates/config/databases/jdbcmysql.yml +0 -0
  28. data/lib/decko/generators/{decko → deck}/templates/config/databases/jdbcpostgresql.yml +0 -0
  29. data/lib/decko/generators/{decko → deck}/templates/config/databases/jdbcsqlite3.yml +0 -0
  30. data/lib/decko/generators/{decko → deck}/templates/config/databases/mysql.yml +0 -0
  31. data/lib/decko/generators/{decko → deck}/templates/config/databases/oracle.yml +0 -0
  32. data/lib/decko/generators/{decko → deck}/templates/config/databases/postgresql.yml +0 -0
  33. data/lib/decko/generators/{decko → deck}/templates/config/databases/sqlite3.yml +0 -0
  34. data/lib/decko/generators/{decko → deck}/templates/config/deck.yml +0 -0
  35. data/lib/decko/generators/{decko/templates/config/environment.rb → deck/templates/config/environment.rb.erb} +2 -2
  36. data/lib/decko/generators/{decko/templates/config/initializers/cypress_on_rails.rb → deck/templates/config/initializers/cypress.rb} +2 -0
  37. data/lib/decko/generators/{decko → deck}/templates/config/puma.rb +5 -5
  38. data/lib/decko/generators/{decko/templates/config/routes.erb → deck/templates/config/routes.rb.erb} +1 -1
  39. data/lib/decko/generators/{decko → deck}/templates/gitignore +0 -0
  40. data/lib/decko/generators/deck/templates/pryrc +6 -0
  41. data/lib/decko/generators/{decko → deck}/templates/public/files/htaccess +0 -0
  42. data/lib/decko/generators/{decko → deck}/templates/public/robots.txt +2 -1
  43. data/lib/decko/generators/deck/templates/rspec.erb +6 -0
  44. data/lib/decko/generators/{decko → deck}/templates/script/decko +2 -1
  45. data/lib/decko/generators/deck/templates/script/decko_cucumber +8 -0
  46. data/lib/decko/generators/deck/templates/script/decko_rspec +8 -0
  47. data/lib/decko/generators/{decko/templates/bin → deck/templates/script}/delayed_job +1 -1
  48. data/lib/decko/generators/deck/templates/simplecov.rb.erb +34 -0
  49. data/lib/decko/generators/{decko/templates/spec/javascripts/support/deck_jasmine.yml → deck/templates/spec/javascripts/support/deck_jasmine.yml.erb} +1 -1
  50. data/lib/decko/generators/{decko/templates/spec/javascripts/support/decko_jasmine.yml → deck/templates/spec/javascripts/support/decko_jasmine.yml.erb} +3 -3
  51. data/lib/decko/generators/{decko → deck}/templates/spec/spec_helper.rb +0 -0
  52. data/lib/decko/mods_spec_helper.rb +3 -4
  53. data/lib/decko/response.rb +1 -0
  54. data/lib/decko/tasks/decko.rake +1 -30
  55. data/lib/decko/tasks/decko/docs.rake +26 -0
  56. data/lib/decko/tasks/decko/tmpsets.rake +25 -0
  57. metadata +61 -76
  58. data/GPL +0 -331
  59. data/LICENSE +0 -16
  60. data/README.rdoc +0 -151
  61. data/app/assets/images/body-bg.bmp +0 -0
  62. data/app/assets/images/body-bg.png +0 -0
  63. data/app/assets/images/external_link.png +0 -0
  64. data/app/assets/images/smoothness/animated-overlay.gif +0 -0
  65. data/app/assets/images/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  66. data/app/assets/images/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
  67. data/app/assets/images/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  68. data/app/assets/images/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
  69. data/app/assets/images/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
  70. data/app/assets/images/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  71. data/app/assets/images/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  72. data/app/assets/images/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  73. data/app/assets/images/smoothness/ui-icons_222222_256x240.png +0 -0
  74. data/app/assets/images/smoothness/ui-icons_2e83ff_256x240.png +0 -0
  75. data/app/assets/images/smoothness/ui-icons_454545_256x240.png +0 -0
  76. data/app/assets/images/smoothness/ui-icons_888888_256x240.png +0 -0
  77. data/app/assets/images/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
  78. data/lib/decko/generators/decko/decko_generator.rb +0 -263
  79. data/lib/decko/generators/decko/decko_generator/interactive.rb +0 -114
  80. data/lib/decko/generators/decko/templates/Gemfile +0 -126
  81. data/lib/decko/generators/decko/templates/config/cucumber.yml +0 -1
  82. data/lib/decko/generators/decko/templates/config/initializers/cypress_dev.rb +0 -10
  83. data/lib/decko/generators/decko/templates/rspec +0 -5
  84. data/lib/decko/generators/decko/templates/simplecov +0 -5
  85. data/rails/application-routes.rb +0 -3
  86. data/rails/assets/external_link.png +0 -0
  87. data/rails/assets/jasmine/404.html +0 -27
  88. data/rails/assets/jasmine/500.html +0 -28
  89. data/rails/assets/jasmine/card_form.html +0 -13
  90. data/rails/assets/jquery.min.map +0 -1
  91. data/rails/controllers/application_controller.rb +0 -2
  92. data/rails/controllers/card_controller.rb +0 -151
  93. data/rails/engine-routes.rb +0 -53
  94. data/script/autospec +0 -4
  95. data/script/decko +0 -6
  96. data/script/rails +0 -6
  97. data/script/test_filter +0 -25
data/LICENSE DELETED
@@ -1,16 +0,0 @@
1
- Wagn
2
- Copyright (C) 2013 Grass Commons
3
-
4
- This program is free software; you can redistribute it and/or
5
- modify it under the terms of the GNU General Public License
6
- as published by the Free Software Foundation; either version 2
7
- of the License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -1,151 +0,0 @@
1
- =Decko: you hold the cards
2
-
3
- {<img src="https://semaphoreci.com/api/v1/ethan/decko/branches/master/shields_badge.svg" />}[https://semaphoreci.com/ethan/decko]
4
- {<img src="https://badge.fury.io/rb/decko.svg" alt="Gem Version" />}[https://badge.fury.io/rb/decko]
5
- {<img src="https://codeclimate.com/repos/56548cb6fafb98574e013c39/badges/be88db3f72d0fd06ace3/gpa.svg" />}[https://codeclimate.com/repos/56548cb6fafb98574e013c39/feed]
6
-
7
- ==Basics
8
-
9
- Decko (formerly known as "Wagn") makes serious web development fun.
10
-
11
- "Deckers" have used Decko to create open community sites, private knowledge management sites, public proposal submission sites with private back-ends for review, project management systems, wikis, blogs, journals, forums, and more.
12
-
13
- Install Decko, open a webpage, and get started. With Decko's wiki-inspired building blocks, you can collaborate from day one on content, design, and structure create elegant web systems on the fly. And ruby developers can take these creations even further with Decko's development framework. Decko's innovative Mods API supports boundless creativity while integrating seamlessly with structures created on the site.
14
-
15
- Try it out!
16
-
17
-
18
- ==System Requirements
19
-
20
-
21
- ==Installation
22
-
23
- ===1. install dependencies
24
-
25
- Ruby[http://www.ruby-lang.org/en/]:: version 2.5 or higher
26
- Bundler[http://gembundler.com/]:: version 1.0 or higher
27
- ImageMagick[http://www.imagemagick.org/]::
28
- A database engine:: Either MySQL[http://www.mysql.com/] or PostgreSQL[http://www.postgresql.org/]
29
- A JavaScript runtime:: Node.js[https://nodejs.org/] or other[https://github.com/sstephenson/execjs]
30
-
31
- ===2. install the gem
32
-
33
- gem install decko
34
-
35
- Watch carefully for errors!
36
-
37
-
38
- ===3. create a new deck
39
-
40
- decko new MY_DECK
41
-
42
- Options:
43
- -f, [--force] # Overwrite files that already exist
44
- -p, [--pretend], [--no-pretend] # Run but do not make any changes
45
- -q, [--quiet], [--no-quiet] # Suppress status output
46
- -s, [--skip], [--no-skip] # Skip files that already exist
47
- -m, [--mod-dev], [--no-mod-dev] # Prepare deck for mod development
48
- -c, [--core-dev], [--no-core-dev] # Prepare deck for core development
49
- -g, [--gem-path=GEM-PATH] # Path to local decko repository (Default, use env DECKO_GEM_PATH)
50
- -i, [--interactive], [--no-interactive] # Prompt with dynamic installation options
51
-
52
- ===4. create / seed database
53
-
54
- Edit the config/database.yml file as necessary. More about database configuration at https://www.decko.org/database_configuration.
55
-
56
- Then run
57
-
58
- cd MY_DECK
59
- decko seed
60
-
61
- ..to create and seed the database
62
-
63
- Options:
64
- -p, --production decko:seed production database (default)
65
- -t, --test decko:seed test database
66
- -d, --development decko:seed development database
67
- -a, --all decko:seed production, test, and development database
68
-
69
-
70
- ===4. start your server
71
-
72
- To fire up the default, built-in WEBrick server, just run:
73
-
74
- decko server
75
-
76
- ...and point your browser to http://localhost:3000 (unless otherwise configured).
77
-
78
- Options:
79
- -p, [--port=port] # Runs Decko on the specified port - defaults to 3000.
80
- -b, [--binding=IP] # Binds Decko to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'.
81
- -c, [--config=file] # Uses a custom rackup configuration. (default: config.ru)
82
- -d, [--daemon], [--no-daemon] # Runs server as a Daemon.
83
- -e, [--environment=name] # Specifies the environment to run this server under (development/test/production).
84
- -P, [--pid=PID] # Specifies the PID file. (efault: tmp/pids/server.pid)
85
- [--early-hints], [--no-early-hints] # Enables HTTP/2 early hints.
86
-
87
- For more information, see https://decko.org/get_started.
88
-
89
-
90
-
91
- ==Upgrading
92
-
93
- ===Standard Upgrade
94
-
95
- ====1. Backups
96
- Always back up your database and uploaded files.
97
-
98
- ====2. Update Libraries
99
-
100
- From your decko root directory run:
101
-
102
- bundle update
103
-
104
- ====3. Update Database
105
-
106
- Run the following:
107
-
108
- decko update
109
-
110
- ====4. Restart your server.
111
-
112
- ===Upgrade to Decko from Wagn
113
-
114
- ====1. update references to "wagn" in file content
115
- In your decko's root directory, edit Gemfile, config/application.rb, and config/routes.rb, and script/wagn,
116
- replacing "wagn" with "decko". (Keep the same capitalization pattern.)
117
-
118
- ====2. update references to "wagn" in file names.
119
- From your decko root directory run:
120
-
121
- mv script/wagn script/decko
122
-
123
- ====3. continue as with Standard Upgrade
124
- See above.
125
-
126
- ===Upgrade pre-gem Wagn site
127
-
128
- First check the Wagn/Decko version of your existing site.
129
-
130
- ====Version 1.10 or newer
131
-
132
- 1. Create a new deck using steps 1 and 2 from the installation section above.
133
- 2. Copy config/database.yml from the old site to the new one.
134
- 3. Copy the old local/files contents to the new "files" directory.
135
- 4. If you have edited wagn.yml in your old site, make the corresponding changes to the new config/application.rb file.
136
- 5. Follow the standard upgrade procedure above.
137
-
138
- ====Older than Version 1.10
139
-
140
- First update your Wagn to version 1.10 via the old update mechanisms, and then follow the directions above.
141
-
142
-
143
- ==More Resources
144
-
145
- If you're new to Decko, you'll find lots more info at https://decko.org
146
-
147
- Installation problems? Installation: https://decko.org/installation
148
-
149
- If you're looking to go deep into the code, start with http://www.rubydoc.info/gems/card
150
-
151
- Thinking about contributing to Decko? here[link:CONTRIBUTING.md]
@@ -1,263 +0,0 @@
1
- require "rails/generators/app_base"
2
-
3
- class DeckoGenerator < Rails::Generators::AppBase
4
- # class DeckoGenerator < Rails::Generators::AppGenerator
5
-
6
- source_root File.expand_path("../templates", __FILE__)
7
-
8
- class_option "mod-dev",
9
- type: :boolean, aliases: "-m", default: false, group: :runtime,
10
- desc: "Prepare deck for mod development"
11
-
12
- class_option "core-dev",
13
- type: :boolean, aliases: "-c", default: false, group: :runtime,
14
- desc: "Prepare deck for core development"
15
-
16
- class_option "gem-path",
17
- type: :string, aliases: "-g", default: "", group: :runtime,
18
- desc: "Path to local decko repository " \
19
- "(Default, use env DECKO_GEM_PATH)"
20
-
21
- class_option :database,
22
- type: :string, aliases: "-d", default: "mysql",
23
- desc: "Preconfigure for selected database " \
24
- "(options: #{DATABASES.join('/')})"
25
-
26
- class_option "interactive",
27
- type: :boolean, aliases: "-i", default: false, group: :runtime,
28
- desc: "Prompt with dynamic installation options"
29
-
30
- public_task :set_default_accessors!
31
- public_task :create_root
32
-
33
- ## should probably eventually use rails-like AppBuilder approach,
34
- # but this is a first step.
35
- def dev_setup
36
- determine_gemfile_gem_path
37
- @include_jasmine_engine = false
38
- if options["core-dev"]
39
- core_dev_setup
40
- elsif options["mod-dev"]
41
- mod_dev_setup
42
- end
43
- end
44
-
45
- def rakefile
46
- template "Rakefile"
47
- end
48
-
49
- # def readme
50
- # copy_file "README", "README.rdoc"
51
- # end
52
-
53
- def mod
54
- empty_directory_with_keep_file "mod"
55
- end
56
-
57
- def log
58
- empty_directory_with_keep_file "log"
59
- end
60
-
61
- def files
62
- empty_directory_with_keep_file "files"
63
- end
64
-
65
- def tmp
66
- empty_directory "tmp"
67
- end
68
-
69
- def gemfile
70
- template "Gemfile"
71
- end
72
-
73
- def configru
74
- template "config.ru"
75
- end
76
-
77
- def gitignore
78
- copy_file "gitignore", ".gitignore"
79
- end
80
-
81
- def config
82
- empty_directory "config"
83
-
84
- inside "config" do
85
- template "application.rb"
86
- template "routes.erb", "routes.rb"
87
- template "environment.rb"
88
- template "boot.rb"
89
- template "databases/#{options[:database]}.yml", "database.yml"
90
- template "cucumber.yml" if options["core-dev"]
91
- template "initializers/cypress_on_rails.rb" if options["core-dev"]
92
- end
93
- end
94
-
95
- def public
96
- empty_directory "public"
97
-
98
- inside "public" do
99
- template "robots.txt"
100
- empty_directory "files"
101
-
102
- inside "files" do
103
- template "htaccess", ".htaccess"
104
- end
105
- end
106
- end
107
-
108
- def script
109
- directory "script" do |content|
110
- "#{shebang}\n" + content
111
- end
112
- chmod "script", 0755 & ~File.umask, verbose: false
113
- end
114
-
115
- public_task :run_bundle
116
-
117
- def seed_data
118
- if options["interactive"]
119
- Interactive.new(options, destination_root).run
120
- else
121
- puts "Now:
122
- 1. Run `cd #{File.basename(destination_root)}` to move your new deck directory
123
- 2. Run `decko seed` to seed your database (see db configuration in config/database.yml).
124
- 3. Run `decko server` to start your server"
125
- end
126
- end
127
-
128
- def database_gemfile_entry
129
- return [] if options[:skip_active_record]
130
- gem_name, gem_version = gem_for_database
131
- msg = "Use #{options[:database]} as the database for Active Record"
132
- GemfileEntry.version gem_name, gem_version, msg
133
- end
134
-
135
- def self.banner
136
- "decko new #{arguments.map(&:usage).join(' ')} [options]"
137
- end
138
-
139
- protected
140
-
141
- def determine_gemfile_gem_path
142
- # TODO: rename or split, gem_path points to the source repo,
143
- # card and decko gems are subdirs
144
- if (env_gem_path = ENV["DECKO_GEM_PATH"]).present?
145
- @gemfile_gem_path = %q(#{ENV['DECKO_GEM_PATH']})
146
- @gem_path = env_gem_path
147
- else
148
- @gemfile_gem_path = @gem_path = options["gem-path"]
149
- end
150
- end
151
-
152
- def core_dev_setup
153
- prompt_for_gem_path
154
- @include_jasmine_engine = true
155
- @spec_path = @gem_path
156
- @spec_helper_path = File.join @spec_path, "card", "spec", "spec_helper"
157
-
158
- # ending slash is important in order to load support and step folders
159
- @features_path = File.join @gem_path, "decko/features/"
160
- @simplecov_config = "card_core_dev_simplecov_filters"
161
- shared_dev_setup
162
- javascript_spec_setup "decko_jasmine"
163
- end
164
-
165
- def prompt_for_gem_path
166
- return if @gem_path.present?
167
- @gemfile_gem_path =
168
- @gem_path = ask("Enter the path to your local decko gem installation: ")
169
- end
170
-
171
- def mod_dev_setup
172
- @spec_path = "mod/"
173
- @spec_helper_path = "./spec/spec_helper"
174
- @simplecov_config = "card_simplecov_filters"
175
- shared_dev_setup
176
- inside("spec") { template "spec_helper.rb" }
177
- javascript_spec_setup "deck_jasmine"
178
- end
179
-
180
- def javascript_spec_setup jasmine_prefix
181
- inside "spec" do
182
- template File.join("javascripts", "support", "#{jasmine_prefix}.yml"),
183
- File.join("javascripts", "support", "jasmine.yml")
184
- end
185
- end
186
-
187
- def shared_dev_setup
188
- @cardio_gem_root = File.join @gem_path, "card"
189
- @decko_gem_root = File.join @gem_path, "decko"
190
- empty_directory "spec"
191
- inside "config" do
192
- template "puma.rb"
193
- end
194
- template "rspec", ".rspec"
195
- template "simplecov", ".simplecov"
196
- empty_directory "bin"
197
- inside "bin" do
198
- template "spring"
199
- end
200
- end
201
-
202
- def mysql_socket
203
- @mysql_socket ||= [
204
- "/tmp/mysql.sock", # default
205
- "/var/run/mysqld/mysqld.sock", # debian/gentoo
206
- "/var/tmp/mysql.sock", # freebsd
207
- "/var/lib/mysql/mysql.sock", # fedora
208
- "/opt/local/lib/mysql/mysql.sock", # fedora
209
- "/opt/local/var/run/mysqld/mysqld.sock", # mac + darwinports + mysql
210
- "/opt/local/var/run/mysql4/mysqld.sock", # mac + darwinports + mysql4
211
- "/opt/local/var/run/mysql5/mysqld.sock", # mac + darwinports + mysql5
212
- "/opt/lampp/var/mysql/mysql.sock" # xampp for linux
213
- ].find { |f| File.exist?(f) } unless RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
214
- end
215
-
216
- ### the following is straight from rails and is focused on checking
217
- # the validity of the app name.needs decko-specific tuning
218
-
219
- def app_name
220
- @app_name ||= if defined_app_const_base?
221
- defined_app_name
222
- else
223
- File.basename(destination_root)
224
- end
225
- end
226
-
227
- def defined_app_name
228
- defined_app_const_base.underscore
229
- end
230
-
231
- def defined_app_const_base
232
- Rails.respond_to?(:application) && defined?(Rails::Application) &&
233
- Decko.application.is_a?(Rails::Application) &&
234
- Decko.application.class.name.sub(/::Application$/, "")
235
- end
236
-
237
- alias defined_app_const_base? defined_app_const_base
238
-
239
- def app_const_base
240
- @app_const_base ||= defined_app_const_base ||
241
- app_name.gsub(/\W/, "_").squeeze("_").camelize
242
- end
243
-
244
- alias camelized app_const_base
245
-
246
- def app_const
247
- @app_const ||= "#{app_const_base}::Application"
248
- end
249
-
250
- def valid_const?
251
- if app_const =~ /^\d/
252
- raise Thor::Error, "Invalid application name #{app_name}. " \
253
- "Please give a name which does not start with numbers."
254
- # elsif RESERVED_NAMES.include?(app_name)
255
- # raise Error, "Invalid application name #{app_name}." \
256
- # "Please give a name which does not match one of the reserved rails words."
257
- elsif Object.const_defined?(app_const_base)
258
- raise Thor::Error, "Invalid application name #{app_name}, " \
259
- "constant #{app_const_base} is already in use. " \
260
- "Please choose another application name."
261
- end
262
- end
263
- end