muck-raker 0.3.18 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/MIT-LICENSE +1 -1
- data/README.rdoc +3 -7
- data/Rakefile +2 -4
- data/VERSION +1 -1
- data/config/initializers/muck_raker.rb +1 -1
- data/lib/muck-raker.rb +2 -0
- data/lib/muck-raker/config.rb +22 -0
- data/lib/muck-raker/engine.rb +12 -0
- data/lib/tasks/muck_raker.rake +152 -0
- data/muck-raker.gemspec +207 -191
- data/test/rails_test/app/controllers/application_controller.rb +21 -0
- data/test/rails_test/app/controllers/default_controller.rb +7 -0
- data/test/rails_test/app/helpers/application_helper.rb +3 -0
- data/test/rails_test/app/models/comment.rb +3 -0
- data/test/rails_test/app/models/profile.rb +3 -0
- data/test/rails_test/app/models/user.rb +9 -0
- data/test/rails_test/app/models/user_session.rb +2 -0
- data/test/rails_test/config/application.rb +42 -0
- data/test/rails_test/config/boot.rb +13 -0
- data/test/rails_test/config/environment.rb +5 -0
- data/test/rails_test/config/environments/development.rb +26 -0
- data/test/rails_test/config/environments/production.rb +49 -0
- data/test/rails_test/config/environments/test.rb +35 -0
- data/test/rails_test/config/initializers/backtrace_silencers.rb +7 -0
- data/test/{rails_root → rails_test}/config/initializers/inflections.rb +2 -2
- data/test/{rails_root → rails_test}/config/initializers/mime_types.rb +0 -0
- data/test/rails_test/config/initializers/muck_raker.rb +13 -0
- data/test/rails_test/config/initializers/secret_token.rb +7 -0
- data/test/rails_test/config/initializers/session_store.rb +8 -0
- data/test/rails_test/config/routes.rb +5 -0
- data/test/{rails_root → rails_test}/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090402033319_add_muck_activities.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090402234137_create_languages.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090426041056_create_countries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090426041103_create_states.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090602041838_create_users.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090602191243_create_muck_raker.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090613173314_create_comments.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090619211125_create_tag_clouds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090623181458_add_grain_size_to_entries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090703175825_denormalize_entries_subjects.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090704220055_create_slugs.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090704220120_acts_as_taggable_on_migration.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090717173900_add_contributor_to_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090717175825_normalize_entries_subjects.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090721043213_change_services_title_to_name.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090723050510_create_feed_parents.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090728165716_add_etag_to_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730044139_add_comment_cache.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730045848_add_comment_cache_to_entries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730154102_allow_null_user.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090803185323_create_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804184247_add_comment_count_to_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804211240_add_entry_id_to_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804231857_add_shares_uri_index.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090818204527_add_activity_indexes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090819030523_add_attachable_to_activities.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090826220530_change_services_sequence_to_sort.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090826225652_create_identity_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827005105_add_identity_fields_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827015308_create_service_categories.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090915041650_aggregations_to_polymorphic.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090922174200_update_oai_endpoints.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090923150807_rename_name_in_aggregation.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090924200750_add_uri_data_template_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091022150615_add_uri_key_to_services.rb +0 -0
- data/test/rails_test/features/step_definitions/comment_steps.rb +11 -0
- data/test/rails_test/features/step_definitions/common_steps.rb +93 -0
- data/test/rails_test/features/step_definitions/web_steps.rb +219 -0
- data/test/rails_test/features/step_definitions/webrat_steps.rb +128 -0
- data/test/rails_test/features/support/custom_env.rb +19 -0
- data/test/rails_test/features/support/env.rb +58 -0
- data/test/rails_test/features/support/paths.rb +33 -0
- data/test/rails_test/public/dispatch.rb +10 -0
- data/test/rails_test/spec/spec_helper.rb +5 -0
- metadata +151 -117
- data/install.rb +0 -1
- data/lib/muck_raker.rb +0 -0
- data/lib/muck_raker/tasks.rb +0 -167
- data/rails/init.rb +0 -2
- data/tasks/muck_raker_tasks.rake +0 -1
- data/test/rails_root/config/boot.rb +0 -109
- data/test/rails_root/config/environment.rb +0 -20
- data/test/rails_root/config/environments/development.rb +0 -21
- data/test/rails_root/config/environments/production.rb +0 -1
- data/test/rails_root/config/environments/test.rb +0 -24
- data/test/rails_root/config/initializers/requires.rb +0 -13
- data/test/rails_root/config/initializers/session_store.rb +0 -8
- data/test/rails_root/config/routes.rb +0 -3
- data/test/rails_root/script/create_project.rb +0 -52
- data/uninstall.rb +0 -1
data/rails/init.rb
DELETED
data/tasks/muck_raker_tasks.rake
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), '/../lib/muck_raker/tasks')
|
@@ -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
|
-
min_version = '1.1.1'
|
86
|
-
unless rubygems_version >= min_version
|
87
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
88
|
-
exit 1
|
89
|
-
end
|
90
|
-
|
91
|
-
rescue LoadError
|
92
|
-
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. 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,20 +0,0 @@
|
|
1
|
-
RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
|
2
|
-
|
3
|
-
require File.join(File.dirname(__FILE__), 'boot')
|
4
|
-
|
5
|
-
# Load a global constant so the initializers can use them
|
6
|
-
require 'ostruct'
|
7
|
-
require 'yaml'
|
8
|
-
::GlobalConfig = OpenStruct.new(YAML.load_file("#{RAILS_ROOT}/config/global_config.yml")[RAILS_ENV])
|
9
|
-
|
10
|
-
class TestGemLocator < Rails::Plugin::Locator
|
11
|
-
def plugins
|
12
|
-
Rails::Plugin.new(File.join(File.dirname(__FILE__), *%w(.. .. ..)))
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
Rails::Initializer.run do |config|
|
17
|
-
config.time_zone = 'UTC'
|
18
|
-
config.gem 'muck-solr', :lib => 'acts_as_solr'
|
19
|
-
config.plugin_locators << TestGemLocator
|
20
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
-
|
3
|
-
# In the development environment your application's code is reloaded on
|
4
|
-
# every request. This slows down response time but is perfect for development
|
5
|
-
# since you don't have to restart the webserver when you make code changes.
|
6
|
-
config.cache_classes = false
|
7
|
-
|
8
|
-
# Log error messages when you accidentally call methods on nil.
|
9
|
-
config.whiny_nils = true
|
10
|
-
|
11
|
-
# Show full error reports and disable caching
|
12
|
-
config.action_controller.consider_all_requests_local = true
|
13
|
-
config.action_controller.perform_caching = false
|
14
|
-
config.action_view.debug_rjs = true
|
15
|
-
|
16
|
-
# Don't care if the mailer can't send
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
18
|
-
|
19
|
-
HOST = "localhost"
|
20
|
-
|
21
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
HOST = "http://example.com"
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
-
|
3
|
-
# The test environment is used exclusively to run your application's
|
4
|
-
# test suite. You never need to work with it otherwise. Remember that
|
5
|
-
# your test database is "scratch space" for the test suite and is wiped
|
6
|
-
# and recreated between test runs. Don't rely on the data there!
|
7
|
-
config.cache_classes = true
|
8
|
-
|
9
|
-
# Log error messages when you accidentally call methods on nil.
|
10
|
-
config.whiny_nils = true
|
11
|
-
|
12
|
-
# Show full error reports and disable caching
|
13
|
-
config.action_controller.consider_all_requests_local = true
|
14
|
-
config.action_controller.perform_caching = false
|
15
|
-
|
16
|
-
# Disable request forgery protection in test environment
|
17
|
-
config.action_controller.allow_forgery_protection = false
|
18
|
-
|
19
|
-
# Tell ActionMailer not to deliver emails to the real world.
|
20
|
-
# The :test delivery method accumulates sent emails in the
|
21
|
-
# ActionMailer::Base.deliveries array.
|
22
|
-
config.action_mailer.delivery_method = :test
|
23
|
-
|
24
|
-
HOST = "localhost"
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Dir[File.join(RAILS_ROOT, 'lib', 'extensions', '*.rb')].each do |f|
|
2
|
-
require f
|
3
|
-
end
|
4
|
-
|
5
|
-
Dir[File.join(RAILS_ROOT, 'lib', '*.rb')].each do |f|
|
6
|
-
require f
|
7
|
-
end
|
8
|
-
|
9
|
-
# Rails 2 doesn't like mocks
|
10
|
-
|
11
|
-
Dir[File.join(RAILS_ROOT, 'test', 'mocks', RAILS_ENV, '*.rb')].each do |f|
|
12
|
-
require f
|
13
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# Your secret key for verifying cookie session data integrity.
|
2
|
-
# If you change this key, all old sessions will become invalid!
|
3
|
-
# Make sure the secret is at least 30 characters and all random,
|
4
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
5
|
-
ActionController::Base.session = {
|
6
|
-
:key => GlobalConfig.session_key,
|
7
|
-
:secret => GlobalConfig.session_secret
|
8
|
-
}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'rubygems'
|
3
|
-
require 'activesupport'
|
4
|
-
require 'pathname'
|
5
|
-
|
6
|
-
project_name = ARGV[0]
|
7
|
-
fail("Usage: #{File.basename(__FILE__)} new_project_name") unless project_name
|
8
|
-
fail("Project name must only contain [a-z0-9_]") unless project_name =~ /^[a-z0-9_]+$/
|
9
|
-
|
10
|
-
base_directory = Pathname.new(File.join(File.dirname(__FILE__), '..', '..')).realpath
|
11
|
-
project_directory = base_directory + project_name
|
12
|
-
fail("Project directory (#{project_directory}) already exists") if project_directory.exist?
|
13
|
-
|
14
|
-
template_url = "git@github.com:thoughtbot/rails-template.git"
|
15
|
-
changeme = "CHANGEME"
|
16
|
-
|
17
|
-
def run(cmd)
|
18
|
-
puts "Running '#{cmd}'"
|
19
|
-
out = `#{cmd}`
|
20
|
-
if $? != 0
|
21
|
-
fail "Command #{cmd} failed: #$?\n#{out}"
|
22
|
-
end
|
23
|
-
out
|
24
|
-
end
|
25
|
-
|
26
|
-
def search_and_replace(file, search, replace)
|
27
|
-
if File.file?(file)
|
28
|
-
contents = File.read(file)
|
29
|
-
if contents[search]
|
30
|
-
puts "Replacing #{search} with #{replace} in #{file}"
|
31
|
-
contents.gsub!(search, replace)
|
32
|
-
File.open(file, "w") { |f| f << contents }
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
run("mkdir #{project_directory}")
|
38
|
-
Dir.chdir(project_directory) or fail("Couldn't change to #{project_directory}")
|
39
|
-
run("git init")
|
40
|
-
run("git remote add template #{template_url}")
|
41
|
-
run("git pull template master")
|
42
|
-
|
43
|
-
Dir.glob("#{project_directory}/**/*").each do |file|
|
44
|
-
search_and_replace(file, changeme, project_name)
|
45
|
-
end
|
46
|
-
|
47
|
-
run("git commit -a -m 'Initial commit'")
|
48
|
-
|
49
|
-
puts
|
50
|
-
puts "Now login to github and add a new project named '#{project_name.humanize.titleize}'"
|
51
|
-
|
52
|
-
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|