squishable 0.0.1
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.
- data/MIT-LICENSE +20 -0
- data/README.md +3 -0
- data/Rakefile +32 -0
- data/app/assets/javascripts/squishable/application.js +9 -0
- data/app/assets/javascripts/squishable/squishes.js +2 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/assets/stylesheets/squishable/application.css +7 -0
- data/app/assets/stylesheets/squishable/squishes.css +4 -0
- data/app/controllers/squishable/application_controller.rb +4 -0
- data/app/controllers/squishable/squishes_controller.rb +85 -0
- data/app/helpers/squishable/application_helper.rb +4 -0
- data/app/helpers/squishable/squishes_helper.rb +4 -0
- data/app/models/squishable/squish.rb +4 -0
- data/app/views/squishable/squishes/_form.html.erb +21 -0
- data/app/views/squishable/squishes/edit.html.erb +6 -0
- data/app/views/squishable/squishes/index.html.erb +23 -0
- data/app/views/squishable/squishes/new.html.erb +5 -0
- data/app/views/squishable/squishes/show.html.erb +10 -0
- data/config/routes.rb +4 -0
- data/db/migrate/20111004030937_create_squishable_squishes.rb +9 -0
- data/lib/squishable.rb +4 -0
- data/lib/squishable/engine.rb +5 -0
- data/lib/squishable/version.rb +3 -0
- data/lib/tasks/squishable_tasks.rake +4 -0
- metadata +130 -0
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2011 Mike Bannister
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
begin
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
rescue LoadError
|
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
6
|
+
end
|
|
7
|
+
begin
|
|
8
|
+
require 'rdoc/task'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
require 'rdoc/rdoc'
|
|
11
|
+
require 'rake/rdoctask'
|
|
12
|
+
RDoc::Task = Rake::RDocTask
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
17
|
+
rdoc.title = 'Squishable'
|
|
18
|
+
rdoc.options << '--line-numbers'
|
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
24
|
+
load 'rails/tasks/engine.rake'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
Bundler::GemHelper.install_tasks
|
|
28
|
+
|
|
29
|
+
require 'rspec/core/rake_task'
|
|
30
|
+
|
|
31
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
32
|
+
task :default => :spec
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
5
|
+
// the compiled file.
|
|
6
|
+
//
|
|
7
|
+
//= require jquery
|
|
8
|
+
//= require jquery_ujs
|
|
9
|
+
//= require_tree .
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
|
2
|
+
|
|
3
|
+
body, p, ol, ul, td {
|
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
|
5
|
+
font-size: 13px;
|
|
6
|
+
line-height: 18px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
pre {
|
|
10
|
+
background-color: #eee;
|
|
11
|
+
padding: 10px;
|
|
12
|
+
font-size: 11px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
a { color: #000; }
|
|
16
|
+
a:visited { color: #666; }
|
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
|
18
|
+
|
|
19
|
+
div.field, div.actions {
|
|
20
|
+
margin-bottom: 10px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#notice {
|
|
24
|
+
color: green;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.field_with_errors {
|
|
28
|
+
padding: 2px;
|
|
29
|
+
background-color: red;
|
|
30
|
+
display: table;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#error_explanation {
|
|
34
|
+
width: 450px;
|
|
35
|
+
border: 2px solid red;
|
|
36
|
+
padding: 7px;
|
|
37
|
+
padding-bottom: 0;
|
|
38
|
+
margin-bottom: 20px;
|
|
39
|
+
background-color: #f0f0f0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#error_explanation h2 {
|
|
43
|
+
text-align: left;
|
|
44
|
+
font-weight: bold;
|
|
45
|
+
padding: 5px 5px 5px 15px;
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
margin: -7px;
|
|
48
|
+
margin-bottom: 0px;
|
|
49
|
+
background-color: #c00;
|
|
50
|
+
color: #fff;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#error_explanation ul li {
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
list-style: square;
|
|
56
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
|
5
|
+
*= require_self
|
|
6
|
+
*= require_tree .
|
|
7
|
+
*/
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
module Squishable
|
|
2
|
+
class SquishesController < ::ApplicationController
|
|
3
|
+
# GET /squishes
|
|
4
|
+
# GET /squishes.json
|
|
5
|
+
def index
|
|
6
|
+
@squishes = Squish.all
|
|
7
|
+
|
|
8
|
+
respond_to do |format|
|
|
9
|
+
format.html # index.html.erb
|
|
10
|
+
format.json { render json: @squishes }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# GET /squishes/1
|
|
15
|
+
# GET /squishes/1.json
|
|
16
|
+
def show
|
|
17
|
+
@squish = Squish.find(params[:id])
|
|
18
|
+
|
|
19
|
+
respond_to do |format|
|
|
20
|
+
format.html # show.html.erb
|
|
21
|
+
format.json { render json: @squish }
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# GET /squishes/new
|
|
26
|
+
# GET /squishes/new.json
|
|
27
|
+
def new
|
|
28
|
+
@squish = Squish.new
|
|
29
|
+
|
|
30
|
+
respond_to do |format|
|
|
31
|
+
format.html # new.html.erb
|
|
32
|
+
format.json { render json: @squish }
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# GET /squishes/1/edit
|
|
37
|
+
def edit
|
|
38
|
+
@squish = Squish.find(params[:id])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# POST /squishes
|
|
42
|
+
# POST /squishes.json
|
|
43
|
+
def create
|
|
44
|
+
@squish = Squish.new(params[:squish])
|
|
45
|
+
|
|
46
|
+
respond_to do |format|
|
|
47
|
+
if @squish.save
|
|
48
|
+
format.html { redirect_to @squish, notice: 'Squish was successfully created.' }
|
|
49
|
+
format.json { render json: @squish, status: :created, location: @squish }
|
|
50
|
+
else
|
|
51
|
+
format.html { render action: "new" }
|
|
52
|
+
format.json { render json: @squish.errors, status: :unprocessable_entity }
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# PUT /squishes/1
|
|
58
|
+
# PUT /squishes/1.json
|
|
59
|
+
def update
|
|
60
|
+
@squish = Squish.find(params[:id])
|
|
61
|
+
|
|
62
|
+
respond_to do |format|
|
|
63
|
+
if @squish.update_attributes(params[:squish])
|
|
64
|
+
format.html { redirect_to @squish, notice: 'Squish was successfully updated.' }
|
|
65
|
+
format.json { head :ok }
|
|
66
|
+
else
|
|
67
|
+
format.html { render action: "edit" }
|
|
68
|
+
format.json { render json: @squish.errors, status: :unprocessable_entity }
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# DELETE /squishes/1
|
|
74
|
+
# DELETE /squishes/1.json
|
|
75
|
+
def destroy
|
|
76
|
+
@squish = Squish.find(params[:id])
|
|
77
|
+
@squish.destroy
|
|
78
|
+
|
|
79
|
+
respond_to do |format|
|
|
80
|
+
format.html { redirect_to squishes_url }
|
|
81
|
+
format.json { head :ok }
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<%= form_for(@squish) do |f| %>
|
|
2
|
+
<% if @squish.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(@squish.errors.count, "error") %> prohibited this squish from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% @squish.errors.full_messages.each do |msg| %>
|
|
8
|
+
<li><%= msg %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= f.label :squash %><br />
|
|
16
|
+
<%= f.text_field :squash %>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="actions">
|
|
19
|
+
<%= f.submit %>
|
|
20
|
+
</div>
|
|
21
|
+
<% end %>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<h1>Listing squishes</h1>
|
|
2
|
+
|
|
3
|
+
<table>
|
|
4
|
+
<tr>
|
|
5
|
+
<th>Squash</th>
|
|
6
|
+
<th></th>
|
|
7
|
+
<th></th>
|
|
8
|
+
<th></th>
|
|
9
|
+
</tr>
|
|
10
|
+
|
|
11
|
+
<% @squishes.each do |squish| %>
|
|
12
|
+
<tr>
|
|
13
|
+
<td><%= squish.squash %></td>
|
|
14
|
+
<td><%= link_to 'Show', squish %></td>
|
|
15
|
+
<td><%= link_to 'Edit', edit_squish_path(squish) %></td>
|
|
16
|
+
<td><%= link_to 'Destroy', squish, confirm: 'Are you sure?', method: :delete %></td>
|
|
17
|
+
</tr>
|
|
18
|
+
<% end %>
|
|
19
|
+
</table>
|
|
20
|
+
|
|
21
|
+
<br />
|
|
22
|
+
|
|
23
|
+
<%= link_to 'New Squish', new_squish_path %>
|
data/config/routes.rb
ADDED
data/lib/squishable.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: squishable
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Mike Bannister
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2011-10-04 00:00:00.000000000Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: rails
|
|
16
|
+
requirement: &70162414911300 !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 3.1.0
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: *70162414911300
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: rack
|
|
27
|
+
requirement: &70162414909560 !ruby/object:Gem::Requirement
|
|
28
|
+
none: false
|
|
29
|
+
requirements:
|
|
30
|
+
- - =
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 1.3.3
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: *70162414909560
|
|
36
|
+
- !ruby/object:Gem::Dependency
|
|
37
|
+
name: rspec-rails
|
|
38
|
+
requirement: &70162414907180 !ruby/object:Gem::Requirement
|
|
39
|
+
none: false
|
|
40
|
+
requirements:
|
|
41
|
+
- - ~>
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: 2.6.1
|
|
44
|
+
type: :development
|
|
45
|
+
prerelease: false
|
|
46
|
+
version_requirements: *70162414907180
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: capybara
|
|
49
|
+
requirement: &70162414905800 !ruby/object:Gem::Requirement
|
|
50
|
+
none: false
|
|
51
|
+
requirements:
|
|
52
|
+
- - ~>
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 1.1.1
|
|
55
|
+
type: :development
|
|
56
|
+
prerelease: false
|
|
57
|
+
version_requirements: *70162414905800
|
|
58
|
+
- !ruby/object:Gem::Dependency
|
|
59
|
+
name: sqlite3
|
|
60
|
+
requirement: &70162414904880 !ruby/object:Gem::Requirement
|
|
61
|
+
none: false
|
|
62
|
+
requirements:
|
|
63
|
+
- - ! '>='
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
type: :development
|
|
67
|
+
prerelease: false
|
|
68
|
+
version_requirements: *70162414904880
|
|
69
|
+
description: Code for Rails::Engine+RSpec+Capybara tutorial
|
|
70
|
+
email:
|
|
71
|
+
- mikebannister@gmail.com
|
|
72
|
+
executables: []
|
|
73
|
+
extensions: []
|
|
74
|
+
extra_rdoc_files: []
|
|
75
|
+
files:
|
|
76
|
+
- app/assets/javascripts/squishable/application.js
|
|
77
|
+
- app/assets/javascripts/squishable/squishes.js
|
|
78
|
+
- app/assets/stylesheets/scaffold.css
|
|
79
|
+
- app/assets/stylesheets/squishable/application.css
|
|
80
|
+
- app/assets/stylesheets/squishable/squishes.css
|
|
81
|
+
- app/controllers/squishable/application_controller.rb
|
|
82
|
+
- app/controllers/squishable/squishes_controller.rb
|
|
83
|
+
- app/helpers/squishable/application_helper.rb
|
|
84
|
+
- app/helpers/squishable/squishes_helper.rb
|
|
85
|
+
- app/models/squishable/squish.rb
|
|
86
|
+
- app/views/squishable/squishes/_form.html.erb
|
|
87
|
+
- app/views/squishable/squishes/edit.html.erb
|
|
88
|
+
- app/views/squishable/squishes/index.html.erb
|
|
89
|
+
- app/views/squishable/squishes/new.html.erb
|
|
90
|
+
- app/views/squishable/squishes/show.html.erb
|
|
91
|
+
- config/routes.rb
|
|
92
|
+
- db/migrate/20111004030937_create_squishable_squishes.rb
|
|
93
|
+
- lib/squishable/engine.rb
|
|
94
|
+
- lib/squishable/version.rb
|
|
95
|
+
- lib/squishable.rb
|
|
96
|
+
- lib/tasks/squishable_tasks.rake
|
|
97
|
+
- MIT-LICENSE
|
|
98
|
+
- Rakefile
|
|
99
|
+
- README.md
|
|
100
|
+
homepage: http://brainbicycle.net/blog/2011/10/03/create-a-rails-engine-with-rspec-and-capybara-tests/
|
|
101
|
+
licenses: []
|
|
102
|
+
post_install_message:
|
|
103
|
+
rdoc_options: []
|
|
104
|
+
require_paths:
|
|
105
|
+
- lib
|
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
|
+
none: false
|
|
108
|
+
requirements:
|
|
109
|
+
- - ! '>='
|
|
110
|
+
- !ruby/object:Gem::Version
|
|
111
|
+
version: '0'
|
|
112
|
+
segments:
|
|
113
|
+
- 0
|
|
114
|
+
hash: 3891904397635009567
|
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
|
+
none: false
|
|
117
|
+
requirements:
|
|
118
|
+
- - ! '>='
|
|
119
|
+
- !ruby/object:Gem::Version
|
|
120
|
+
version: '0'
|
|
121
|
+
segments:
|
|
122
|
+
- 0
|
|
123
|
+
hash: 3891904397635009567
|
|
124
|
+
requirements: []
|
|
125
|
+
rubyforge_project:
|
|
126
|
+
rubygems_version: 1.8.10
|
|
127
|
+
signing_key:
|
|
128
|
+
specification_version: 3
|
|
129
|
+
summary: Code for Rails::Engine+RSpec+Capybara tutorial
|
|
130
|
+
test_files: []
|