decko 0.6.8 → 0.7.0.pre

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a01cd6c3dc6acfb1c1182149a45b0e25925f5dea
4
- data.tar.gz: 6dec91fd8fd9b21cc9490ed976d0a060f5db8fb2
3
+ metadata.gz: a79047a348903dd9793edf85cb5d9bbdd6f63308
4
+ data.tar.gz: cac43ee279c0c466df819d890afa02671253de16
5
5
  SHA512:
6
- metadata.gz: 1f041ce2aa0ebf5e1f64976355d5b25ba411c73ce42e684ac6da068804dac02205b4eb2002b86f2cf36354128d47cee1b4a8829253393e9310a616a0368f1088
7
- data.tar.gz: 5fee480118e6d2cf34b5db84889ec64781b8bd5a42cd645b5ca1d908b898cad254a1e289585ade20787b7846437d95df7aeb80d8b044327b33b5504a6d8f6e56
6
+ metadata.gz: 65102a60f9db30535b9229e73c57bc47a9ba442453251fda1ea4b6e2c81e961aa884f08a0ec3747653208e4a546df2a73f0361f7afe7ba81ff28b8001893f1d7
7
+ data.tar.gz: 45a4f71dbc6cd4cfac8ff1b9329c65a28124e3d8eb5a55cc89a4ef8beee46cc821c77918daee03d207c5a16495012375562bd18ae0e150ef7c8fc7ec0faf46c7
@@ -24,6 +24,7 @@ Decko.application.class.configure do
24
24
  if defined?(RailsDevTweaks)
25
25
  config.dev_tweaks.autoload_rules do
26
26
  skip "/files"
27
+ skip "/favicon.ico"
27
28
  skip /view\=status/
28
29
  end
29
30
  end
@@ -98,6 +99,7 @@ Decko.application.class.configure do
98
99
  rescue LoadError
99
100
  end
100
101
  end
102
+ #config.session_store :cookie_store
101
103
  end
102
104
 
103
105
  # Paperclip.options[:command_path] = "/opt/local/bin"
@@ -88,6 +88,7 @@ class DeckoGenerator < Rails::Generators::AppBase
88
88
  template "boot.rb"
89
89
  template "databases/#{options[:database]}.yml", "database.yml"
90
90
  template "cucumber.yml" if options["core-dev"]
91
+ template "initializers/cypress_dev.rb" if options["core-dev"]
91
92
  end
92
93
  end
93
94
 
@@ -28,14 +28,19 @@ gem 'thin'
28
28
 
29
29
  <% if options['mod-dev'] || options['core-dev'] -%>
30
30
  group :test do
31
+ gem 'capybara-puma'
31
32
  gem 'rspec'
32
33
  gem 'rspec-rails', '~>3.6.1' # behavior-driven-development suite
33
34
  gem 'spork', '>=0.9'
34
35
  gem 'rubocop'
35
36
  gem 'rubocop-decko'
37
+ gem 'nokogumbo'
36
38
  end
37
39
 
38
40
  group :test, :development do
41
+ gem 'colorize'
42
+ gem 'cypress-on-rails', '~> 1.2'
43
+ gem 'delayed_job_active_record', '~> 4.1'
39
44
  gem 'html2haml'
40
45
  gem 'rails-dev-tweaks'
41
46
  # gem 'jasmine'
@@ -43,8 +48,9 @@ group :test, :development do
43
48
  # gem 'jasmine-jquery-rails'
44
49
  gem 'sprockets' # just so above works
45
50
  gem 'phantomjs', '1.9.7.1' #locked because 1.9.8.0 is breaking
46
- gem 'colorize'
47
- gem 'delayed_job_active_record', '~> 4.1'
51
+
52
+ gem 'better_errors'
53
+ gem 'binding_of_caller'
48
54
 
49
55
  <%- if spring_install? %>
50
56
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
@@ -73,6 +79,7 @@ group :assets do
73
79
  end
74
80
 
75
81
  group :test do
82
+ gem 'capybara-select2', :git=>'https://github.com/brunocavalcante/capybara-select2'
76
83
  gem 'fog'
77
84
  gem 'fog-aws'
78
85
  gem 'rails-controller-testing'
@@ -89,10 +96,10 @@ group :test do
89
96
  end
90
97
 
91
98
  # CUKES see features dir
92
- gem 'cucumber-rails', '~> 1.5', :require=>false # feature-driven-development suite
93
- gem 'capybara', '~> 2.14'
94
- gem 'selenium-webdriver', '3.6.0'
95
- gem 'chromedriver-helper', '~> 1.1.0'
99
+ gem 'cucumber-rails', '~> 1.6', :require=>false # feature-driven-development suite
100
+ gem 'capybara', '~> 3.12'
101
+ gem 'selenium-webdriver', '3.141.0'
102
+ gem 'chromedriver-helper', '~> 2.1.0'
96
103
  # gem 'capybara-webkit'
97
104
  gem 'launchy' # lets cucumber launch browser windows
98
105
 
@@ -109,11 +116,6 @@ group :test do
109
116
  end
110
117
 
111
118
  gem 'ruby-prof', :group=>:profile # profiling
112
-
113
- group :debug do
114
- gem 'better_errors'
115
- gem 'binding_of_caller'
116
- end
117
119
  <% end %>
118
120
 
119
121
  # load gems needed in Gemfiles
@@ -0,0 +1,9 @@
1
+ if defined?(CypressDev)
2
+ CypressDev.configure do |c|
3
+ c.cypress_folder = File.join Decko.gem_root, "spec", "cypress"
4
+ # WARNING!! CypressDev can execute arbitrary ruby code
5
+ # please use with extra caution if enabling on hosted servers or starting your local server on 0.0.0.0
6
+ c.use_middleware = Rails.env.test? || ENV["CYPRESS_DEV"]
7
+ c.logger = Rails.logger
8
+ end
9
+ end
@@ -53,11 +53,20 @@ module Decko
53
53
 
54
54
  # (obviously) deprecated
55
55
  def send_deprecated_asset
56
- filename = [params[:mark], params[:format]].join(".")
57
- # for security, block relative paths
58
- raise Card::Error::BadAddress if filename.include? "../"
56
+ filename = [params[:mark], params[:format]].compact.join(".")
57
+ send_file asset_file_path(filename), x_sendfile: true
58
+ end
59
+
60
+ def asset_file_path filename
59
61
  path = Decko::Engine.paths["gem-assets"].existent.first
60
- send_file File.join(path, filename), x_sendfile: true
62
+ path = File.join path, filename
63
+ validate_path filename, path
64
+ path
65
+ end
66
+
67
+ def validate_path filename, path
68
+ # for security, block relative paths
69
+ raise Card::Error::BadAddress if filename.include?("../") || !::File.exist?(path)
61
70
  end
62
71
 
63
72
  # TODO: everything below should go in a separate file
@@ -116,20 +116,29 @@ class CardController < ActionController::Base
116
116
  end
117
117
 
118
118
  def render_page format, view
119
- view ||= params[:view]
119
+ view ||= view_from_params
120
120
  card.act do
121
121
  format.page self, view, Card::Env.slot_opts
122
122
  end
123
123
  end
124
124
 
125
+ def view_from_params
126
+ params[:view] || params[:v]
127
+ end
128
+
125
129
  def handle_exception exception
130
+ raise exception if debug_exception?(exception)
126
131
  @card ||= Card.new
127
- Card::Error.current = exception
128
- error = Card::Error.cardify_exception exception, card
129
- error.report
132
+ error = Card::Error.report exception, card
130
133
  show error.class.view, error.class.status_code
131
134
  end
132
135
 
136
+ def debug_exception? e
137
+ !e.is_a?(Card::Error::UserError) &&
138
+ !e.is_a?(ActiveRecord::RecordInvalid) &&
139
+ Card[:debugger]&.content =~ /on/ # && !Card::Env.ajax?
140
+ end
141
+
133
142
  class << self
134
143
  def rescue_from_class klass
135
144
  rescue_from(klass) { |exception| handle_exception exception }
@@ -141,5 +150,6 @@ class CardController < ActionController::Base
141
150
  end
142
151
 
143
152
  rescue_from_class ActiveRecord::RecordInvalid
144
- rescue_from_class(rescue_all? ? StandardError : Card::Error::UserError)
153
+ rescue_from_class Card::Error::UserError
154
+ rescue_from_class StandardError if rescue_all?
145
155
  end
@@ -44,6 +44,9 @@ Decko::Engine.routes.draw do
44
44
  match "(card)/update(/:mark(.:format))" => "card#update", via: %i[post put patch]
45
45
  match "(card)/delete(/:mark(.:format))" => "card#delete", via: :delete
46
46
 
47
+ # for super-lazy under-achievers
48
+ get ":mark/:view(.:format)" => "card#read"
49
+
47
50
  # Wildcard for bad addresses
48
51
  get "*mark" => "card#read", view: "bad_address"
49
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.7.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-01-25 00:00:00.000000000 Z
14
+ date: 2019-03-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: card
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.96.8
22
+ version: 1.97.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.96.8
29
+ version: 1.97.0
30
30
  description: a wiki approach to stuctured data, dynamic interaction, and web design
31
31
  email:
32
32
  - info@decko.org
@@ -101,6 +101,7 @@ files:
101
101
  - lib/decko/generators/decko/templates/config/databases/sqlite3.yml
102
102
  - lib/decko/generators/decko/templates/config/deck.yml
103
103
  - lib/decko/generators/decko/templates/config/environment.rb
104
+ - lib/decko/generators/decko/templates/config/initializers/cypress_dev.rb
104
105
  - lib/decko/generators/decko/templates/config/routes.erb
105
106
  - lib/decko/generators/decko/templates/gitignore
106
107
  - lib/decko/generators/decko/templates/public/files/htaccess
@@ -145,12 +146,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
146
  requirements:
146
147
  - - ">="
147
148
  - !ruby/object:Gem::Version
148
- version: '2.3'
149
+ version: 2.4.1
149
150
  required_rubygems_version: !ruby/object:Gem::Requirement
150
151
  requirements:
151
- - - ">="
152
+ - - ">"
152
153
  - !ruby/object:Gem::Version
153
- version: '0'
154
+ version: 1.3.1
154
155
  requirements: []
155
156
  rubyforge_project:
156
157
  rubygems_version: 2.6.13