carlosbrando-remarkable 2.2.1 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +0 -83
- data/Rakefile +8 -1
- data/lib/remarkable.rb +1 -1
- data/lib/remarkable/active_record/macros/database/column_matcher.rb +6 -53
- data/lib/remarkable/active_record/macros/validations/allow_mass_assignment_of_matcher.rb +2 -2
- data/lib/remarkable/active_record/macros/validations/protect_attributes_matcher.rb +1 -1
- data/remarkable.gemspec +6 -5
- metadata +6 -87
- data/spec/controllers/posts_controller_spec.rb +0 -220
- data/spec/controllers/users_controller_spec.rb +0 -15
- data/spec/fixtures/addresses.yml +0 -3
- data/spec/fixtures/fleas.yml +0 -10
- data/spec/fixtures/friendships.yml +0 -0
- data/spec/fixtures/posts.yml +0 -5
- data/spec/fixtures/products.yml +0 -0
- data/spec/fixtures/taggings.yml +0 -0
- data/spec/fixtures/tags.yml +0 -9
- data/spec/fixtures/users.yml +0 -13
- data/spec/models/address_spec.rb +0 -65
- data/spec/models/dog_spec.rb +0 -78
- data/spec/models/flea_spec.rb +0 -39
- data/spec/models/friendship_spec.rb +0 -13
- data/spec/models/post_spec.rb +0 -69
- data/spec/models/product_spec.rb +0 -122
- data/spec/models/tag_spec.rb +0 -21
- data/spec/models/tagging_spec.rb +0 -37
- data/spec/models/user_spec.rb +0 -292
- data/spec/other/custom_macros_spec.rb +0 -27
- data/spec/other/my_own_matcher_spec.rb +0 -11
- data/spec/other/private_helpers_spec.rb +0 -31
- data/spec/rails_root/app/controllers/application.rb +0 -25
- data/spec/rails_root/app/controllers/posts_controller.rb +0 -87
- data/spec/rails_root/app/controllers/users_controller.rb +0 -84
- data/spec/rails_root/app/helpers/application_helper.rb +0 -3
- data/spec/rails_root/app/helpers/posts_helper.rb +0 -2
- data/spec/rails_root/app/helpers/users_helper.rb +0 -2
- data/spec/rails_root/app/models/address.rb +0 -7
- data/spec/rails_root/app/models/flea.rb +0 -7
- data/spec/rails_root/app/models/friendship.rb +0 -4
- data/spec/rails_root/app/models/pets/dog.rb +0 -12
- data/spec/rails_root/app/models/post.rb +0 -12
- data/spec/rails_root/app/models/product.rb +0 -14
- data/spec/rails_root/app/models/tag.rb +0 -8
- data/spec/rails_root/app/models/tagging.rb +0 -6
- data/spec/rails_root/app/models/user.rb +0 -43
- data/spec/rails_root/app/views/layouts/posts.rhtml +0 -19
- data/spec/rails_root/app/views/layouts/users.rhtml +0 -17
- data/spec/rails_root/app/views/layouts/wide.html.erb +0 -1
- data/spec/rails_root/app/views/posts/edit.rhtml +0 -27
- data/spec/rails_root/app/views/posts/index.rhtml +0 -25
- data/spec/rails_root/app/views/posts/new.rhtml +0 -26
- data/spec/rails_root/app/views/posts/show.rhtml +0 -18
- data/spec/rails_root/app/views/users/edit.rhtml +0 -22
- data/spec/rails_root/app/views/users/index.rhtml +0 -22
- data/spec/rails_root/app/views/users/new.rhtml +0 -21
- data/spec/rails_root/app/views/users/show.rhtml +0 -13
- data/spec/rails_root/config/boot.rb +0 -109
- data/spec/rails_root/config/database.yml +0 -3
- data/spec/rails_root/config/environment.rb +0 -16
- data/spec/rails_root/config/environments/test.rb +0 -0
- data/spec/rails_root/config/initializers/new_rails_defaults.rb +0 -15
- data/spec/rails_root/config/initializers/shoulda.rb +0 -8
- data/spec/rails_root/config/locales/en.yml +0 -8
- data/spec/rails_root/config/routes.rb +0 -6
- data/spec/rails_root/db/migrate/001_create_users.rb +0 -18
- data/spec/rails_root/db/migrate/002_create_posts.rb +0 -13
- data/spec/rails_root/db/migrate/003_create_taggings.rb +0 -12
- data/spec/rails_root/db/migrate/004_create_tags.rb +0 -11
- data/spec/rails_root/db/migrate/005_create_dogs.rb +0 -13
- data/spec/rails_root/db/migrate/006_create_addresses.rb +0 -14
- data/spec/rails_root/db/migrate/007_create_fleas.rb +0 -11
- data/spec/rails_root/db/migrate/008_create_dogs_fleas.rb +0 -12
- data/spec/rails_root/db/migrate/009_create_products.rb +0 -17
- data/spec/rails_root/db/migrate/010_create_friendships.rb +0 -14
- data/spec/rails_root/db/migrate/011_add_fleas_color.rb +0 -10
- data/spec/rails_root/db/migrate/012_add_fleas_address.rb +0 -10
- data/spec/rails_root/db/schema.rb +0 -0
- data/spec/rails_root/log/.keep +0 -0
- data/spec/rails_root/public/.htaccess +0 -40
- data/spec/rails_root/public/404.html +0 -30
- data/spec/rails_root/public/422.html +0 -30
- data/spec/rails_root/public/500.html +0 -30
- data/spec/rails_root/script/console +0 -3
- data/spec/rails_root/script/generate +0 -3
- data/spec/rails_root/spec/remarkable_macros/.keep +0 -0
- data/spec/rails_root/vendor/plugins/.keep +0 -0
- data/spec/rails_root/vendor/plugins/my_plugin/remarkable_macros/.keep +0 -0
- data/spec/rcov.opts +0 -2
- data/spec/spec.opts +0 -4
- data/spec/spec_helper.rb +0 -56
@@ -1,18 +0,0 @@
|
|
1
|
-
<p>
|
2
|
-
<b>User:</b>
|
3
|
-
<%=h @post.user_id %>
|
4
|
-
</p>
|
5
|
-
|
6
|
-
<p>
|
7
|
-
<b>Title:</b>
|
8
|
-
<%=h @post.title %>
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<p>
|
12
|
-
<b>Body:</b>
|
13
|
-
<%=h @post.body %>
|
14
|
-
</p>
|
15
|
-
|
16
|
-
|
17
|
-
<%= link_to 'Edit', edit_user_post_path(@post.user, @post) %> |
|
18
|
-
<%= link_to 'Back', user_posts_path(@post.user) %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<h1>Editing user</h1>
|
2
|
-
|
3
|
-
<%= error_messages_for :user %>
|
4
|
-
|
5
|
-
<% form_for(:user, :url => user_path(@user), :html => { :method => :put }) do |f| %>
|
6
|
-
<p>
|
7
|
-
<b>Email</b><br />
|
8
|
-
<%= f.text_field :email %>
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<p>
|
12
|
-
<b>Age</b><br />
|
13
|
-
<%= f.text_field :age %>
|
14
|
-
</p>
|
15
|
-
|
16
|
-
<p>
|
17
|
-
<%= submit_tag "Update" %>
|
18
|
-
</p>
|
19
|
-
<% end %>
|
20
|
-
|
21
|
-
<%= link_to 'Show', user_path(@user) %> |
|
22
|
-
<%= link_to 'Back', users_path %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<h1>Listing users</h1>
|
2
|
-
|
3
|
-
<table>
|
4
|
-
<tr>
|
5
|
-
<th>Email</th>
|
6
|
-
<th>Age</th>
|
7
|
-
</tr>
|
8
|
-
|
9
|
-
<% for user in @users %>
|
10
|
-
<tr>
|
11
|
-
<td><%=h user.email %></td>
|
12
|
-
<td><%=h user.age %></td>
|
13
|
-
<td><%= link_to 'Show', user_path(user) %></td>
|
14
|
-
<td><%= link_to 'Edit', edit_user_path(user) %></td>
|
15
|
-
<td><%= link_to 'Destroy', user_path(user), :confirm => 'Are you sure?', :method => :delete %></td>
|
16
|
-
</tr>
|
17
|
-
<% end %>
|
18
|
-
</table>
|
19
|
-
|
20
|
-
<br />
|
21
|
-
|
22
|
-
<%= link_to 'New user', new_user_path %>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<h1>New user</h1>
|
2
|
-
|
3
|
-
<%= error_messages_for :user %>
|
4
|
-
|
5
|
-
<% form_for(:user, :url => users_path) do |f| %>
|
6
|
-
<p>
|
7
|
-
<b>Email</b><br />
|
8
|
-
<%= f.text_field :email %>
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<p>
|
12
|
-
<b>Age</b><br />
|
13
|
-
<%= f.text_field :age %>
|
14
|
-
</p>
|
15
|
-
|
16
|
-
<p>
|
17
|
-
<%= submit_tag "Create" %>
|
18
|
-
</p>
|
19
|
-
<% end %>
|
20
|
-
|
21
|
-
<%= link_to 'Back', users_path %>
|
@@ -1,109 +0,0 @@
|
|
1
|
-
# Don't change this file!
|
2
|
-
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
-
|
4
|
-
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
-
|
6
|
-
module Rails
|
7
|
-
class << self
|
8
|
-
def boot!
|
9
|
-
unless booted?
|
10
|
-
preinitialize
|
11
|
-
pick_boot.run
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def booted?
|
16
|
-
defined? Rails::Initializer
|
17
|
-
end
|
18
|
-
|
19
|
-
def pick_boot
|
20
|
-
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
-
end
|
22
|
-
|
23
|
-
def vendor_rails?
|
24
|
-
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
-
end
|
26
|
-
|
27
|
-
def preinitialize
|
28
|
-
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
-
end
|
30
|
-
|
31
|
-
def preinitializer_path
|
32
|
-
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Boot
|
37
|
-
def run
|
38
|
-
load_initializer
|
39
|
-
Rails::Initializer.run(:set_load_path)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
class VendorBoot < Boot
|
44
|
-
def load_initializer
|
45
|
-
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
-
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
class GemBoot < Boot
|
51
|
-
def load_initializer
|
52
|
-
self.class.load_rubygems
|
53
|
-
load_rails_gem
|
54
|
-
require 'initializer'
|
55
|
-
end
|
56
|
-
|
57
|
-
def load_rails_gem
|
58
|
-
if version = self.class.gem_version
|
59
|
-
gem 'rails', version
|
60
|
-
else
|
61
|
-
gem 'rails'
|
62
|
-
end
|
63
|
-
rescue Gem::LoadError => load_error
|
64
|
-
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
65
|
-
exit 1
|
66
|
-
end
|
67
|
-
|
68
|
-
class << self
|
69
|
-
def rubygems_version
|
70
|
-
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
71
|
-
end
|
72
|
-
|
73
|
-
def gem_version
|
74
|
-
if defined? RAILS_GEM_VERSION
|
75
|
-
RAILS_GEM_VERSION
|
76
|
-
elsif ENV.include?('RAILS_GEM_VERSION')
|
77
|
-
ENV['RAILS_GEM_VERSION']
|
78
|
-
else
|
79
|
-
parse_gem_version(read_environment_rb)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def load_rubygems
|
84
|
-
require 'rubygems'
|
85
|
-
|
86
|
-
unless rubygems_version >= '0.9.4'
|
87
|
-
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
|
-
exit 1
|
89
|
-
end
|
90
|
-
|
91
|
-
rescue LoadError
|
92
|
-
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
93
|
-
exit 1
|
94
|
-
end
|
95
|
-
|
96
|
-
def parse_gem_version(text)
|
97
|
-
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
98
|
-
end
|
99
|
-
|
100
|
-
private
|
101
|
-
def read_environment_rb
|
102
|
-
File.read("#{RAILS_ROOT}/config/environment.rb")
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
# All that for this:
|
109
|
-
Rails.boot!
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# Specifies gem version of Rails to use when vendor/rails is not present
|
2
|
-
ENV['RAILS_ENV'] = 'test'
|
3
|
-
|
4
|
-
old_verbose, $VERBOSE = $VERBOSE, nil
|
5
|
-
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
|
6
|
-
$VERBOSE = old_verbose
|
7
|
-
|
8
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
9
|
-
|
10
|
-
Rails::Initializer.run do |config|
|
11
|
-
config.log_level = :debug
|
12
|
-
config.cache_classes = false
|
13
|
-
config.whiny_nils = true
|
14
|
-
end
|
15
|
-
|
16
|
-
# Dependencies.log_activity = true
|
File without changes
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# These settings change the behavior of Rails 2 apps and will be defaults
|
2
|
-
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
3
|
-
|
4
|
-
# Include Active Record class name as root for JSON serialized output.
|
5
|
-
ActiveRecord::Base.include_root_in_json = true
|
6
|
-
|
7
|
-
# Store the full class name (including module namespace) in STI type column.
|
8
|
-
ActiveRecord::Base.store_full_sti_class = true
|
9
|
-
|
10
|
-
# Use ISO 8601 format for JSON serialized times and dates.
|
11
|
-
ActiveSupport.use_standard_json_time_format = true
|
12
|
-
|
13
|
-
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
14
|
-
# if you're including raw json in an HTML page.
|
15
|
-
ActiveSupport.escape_html_entities_in_json = false
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# This simulates loading the shoulda plugin, but without relying on
|
2
|
-
# vendor/plugins
|
3
|
-
|
4
|
-
shoulda_path = File.join(File.dirname(__FILE__), *%w(.. .. .. ..))
|
5
|
-
shoulda_lib_path = File.join(shoulda_path, "lib")
|
6
|
-
|
7
|
-
$LOAD_PATH.unshift(shoulda_lib_path)
|
8
|
-
load File.join(shoulda_path, "init.rb")
|
@@ -1,18 +0,0 @@
|
|
1
|
-
class CreateUsers < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :users do |t|
|
4
|
-
t.column :name, :string
|
5
|
-
t.column :email, :string
|
6
|
-
t.column :age, :integer
|
7
|
-
t.column :ssn, :string
|
8
|
-
end
|
9
|
-
add_index :users, :email, :unique => true
|
10
|
-
add_index :users, :name
|
11
|
-
add_index :users, :age
|
12
|
-
add_index :users, [:email, :name], :unique => true
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.down
|
16
|
-
drop_table :users
|
17
|
-
end
|
18
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class CreateAddresses < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :addresses do |t|
|
4
|
-
t.column :title, :string
|
5
|
-
t.column :addressable_id, :integer
|
6
|
-
t.column :addressable_type, :string
|
7
|
-
t.column :zip, :string
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.down
|
12
|
-
drop_table :addresses
|
13
|
-
end
|
14
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class CreateProducts < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :products do |t|
|
4
|
-
t.string :title
|
5
|
-
t.integer :price
|
6
|
-
t.integer :weight
|
7
|
-
t.string :size
|
8
|
-
t.boolean :tangible
|
9
|
-
|
10
|
-
t.timestamps
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.down
|
15
|
-
drop_table :products
|
16
|
-
end
|
17
|
-
end
|