feedreader 0.2.3

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.
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby
2
+
3
+ if ARGV.empty?
4
+ puts "Usage: benchmarker times 'Person.expensive_way' 'Person.another_expensive_way' ..."
5
+ exit
6
+ end
7
+
8
+ require File.dirname(__FILE__) + '/../config/environment'
9
+ require 'benchmark'
10
+ include Benchmark
11
+
12
+ # Don't include compilation in the benchmark
13
+ ARGV[1..-1].each { |expression| eval(expression) }
14
+
15
+ bm(6) do |x|
16
+ ARGV[1..-1].each_with_index do |expression, idx|
17
+ x.report("##{idx + 1}") { ARGV[0].to_i.times { eval(expression) } }
18
+ end
19
+ end
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/ruby
2
+ require 'rubygems'
3
+ require_gem 'rails'
4
+ require 'breakpoint_client'
data/script/console ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/ruby
2
+ irb = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'
3
+
4
+ require 'optparse'
5
+ options = { :sandbox => false, :irb => irb }
6
+ OptionParser.new do |opt|
7
+ opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |options[:sandbox]| }
8
+ opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |options[:irb]| }
9
+ opt.parse!(ARGV)
10
+ end
11
+
12
+ libs = " -r irb/completion"
13
+ libs << " -r #{File.dirname(__FILE__)}/../config/environment"
14
+ libs << " -r console_sandbox" if options[:sandbox]
15
+
16
+ ENV['RAILS_ENV'] = ARGV.first || 'development'
17
+ if options[:sandbox]
18
+ puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
19
+ puts "Any modifications you make will be rolled back on exit."
20
+ else
21
+ puts "Loading #{ENV['RAILS_ENV']} environment."
22
+ end
23
+ exec "#{options[:irb]} #{libs} --prompt-mode simple"
data/script/destroy ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby
2
+ require File.dirname(__FILE__) + '/../config/environment'
3
+ require 'rails_generator'
4
+ require 'rails_generator/scripts/destroy'
5
+
6
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
7
+ Rails::Generator::Scripts::Destroy.new.run(ARGV)
data/script/generate ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/ruby
2
+ require File.dirname(__FILE__) + '/../config/environment'
3
+ require 'rails_generator'
4
+ require 'rails_generator/scripts/generate'
5
+
6
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
7
+ Rails::Generator::Scripts::Generate.new.run(ARGV)
data/script/profiler ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/ruby
2
+ if ARGV.empty?
3
+ $stderr.puts "Usage: profiler 'Person.expensive_method(10)' [times]"
4
+ exit(1)
5
+ end
6
+
7
+ # Keep the expensive require out of the profile.
8
+ $stderr.puts 'Loading Rails...'
9
+ require File.dirname(__FILE__) + '/../config/environment'
10
+
11
+ # Define a method to profile.
12
+ if ARGV[1] and ARGV[1].to_i > 1
13
+ eval "def profile_me() #{ARGV[1]}.times { #{ARGV[0]} } end"
14
+ else
15
+ eval "def profile_me() #{ARGV[0]} end"
16
+ end
17
+
18
+ # Use the ruby-prof extension if available. Fall back to stdlib profiler.
19
+ begin
20
+ require 'prof'
21
+ $stderr.puts 'Using the ruby-prof extension.'
22
+ Prof.clock_mode = Prof::GETTIMEOFDAY
23
+ Prof.start
24
+ profile_me
25
+ results = Prof.stop
26
+ require 'rubyprof_ext'
27
+ Prof.print_profile(results, $stderr)
28
+ rescue LoadError
29
+ $stderr.puts 'Using the standard Ruby profiler.'
30
+ Profiler__.start_profile
31
+ profile_me
32
+ Profiler__.stop_profile
33
+ Profiler__.print_profile($stderr)
34
+ end
data/script/runner ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/ruby
2
+ require 'optparse'
3
+
4
+ options = { :environment => "development" }
5
+
6
+ ARGV.options do |opts|
7
+ script_name = File.basename($0)
8
+ opts.banner = "Usage: runner 'puts Person.find(1).name' [options]"
9
+
10
+ opts.separator ""
11
+
12
+ opts.on("-e", "--environment=name", String,
13
+ "Specifies the environment for the runner to operate under (test/development/production).",
14
+ "Default: development") { |options[:environment]| }
15
+
16
+ opts.separator ""
17
+
18
+ opts.on("-h", "--help",
19
+ "Show this help message.") { puts opts; exit }
20
+
21
+ opts.parse!
22
+ end
23
+
24
+ ENV["RAILS_ENV"] = options[:environment]
25
+
26
+ #!/usr/local/bin/ruby
27
+
28
+ require File.dirname(__FILE__) + '/../config/environment'
29
+ eval(ARGV.first)
data/script/server ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'webrick'
4
+ require 'optparse'
5
+
6
+ OPTIONS = {
7
+ :port => 3000,
8
+ :ip => "0.0.0.0",
9
+ :environment => "development",
10
+ :server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"),
11
+ :server_type => WEBrick::SimpleServer
12
+ }
13
+
14
+ ARGV.options do |opts|
15
+ script_name = File.basename($0)
16
+ opts.banner = "Usage: ruby #{script_name} [options]"
17
+
18
+ opts.separator ""
19
+
20
+ opts.on("-p", "--port=port", Integer,
21
+ "Runs Rails on the specified port.",
22
+ "Default: 3000") { |OPTIONS[:port]| }
23
+ opts.on("-b", "--binding=ip", String,
24
+ "Binds Rails to the specified ip.",
25
+ "Default: 0.0.0.0") { |OPTIONS[:ip]| }
26
+ opts.on("-e", "--environment=name", String,
27
+ "Specifies the environment to run this server under (test/development/production).",
28
+ "Default: development") { |OPTIONS[:environment]| }
29
+ opts.on("-d", "--daemon",
30
+ "Make Rails run as a Daemon (only works if fork is available -- meaning on *nix)."
31
+ ) { OPTIONS[:server_type] = WEBrick::Daemon }
32
+
33
+ opts.separator ""
34
+
35
+ opts.on("-h", "--help",
36
+ "Show this help message.") { puts opts; exit }
37
+
38
+ opts.parse!
39
+ end
40
+
41
+ ENV["RAILS_ENV"] = OPTIONS[:environment]
42
+ require File.dirname(__FILE__) + "/../config/environment"
43
+ require 'webrick_server'
44
+
45
+ OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT)
46
+
47
+ puts "=> Rails application started on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
48
+ puts "=> Ctrl-C to shutdown server; call with --help for options" if OPTIONS[:server_type] == WEBrick::SimpleServer
49
+ DispatchServlet.dispatch(OPTIONS)
@@ -0,0 +1,18 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ require 'feed_controller'
3
+
4
+ # Re-raise errors caught by the controller.
5
+ class FeedController; def rescue_action(e) raise e end; end
6
+
7
+ class FeedControllerTest < Test::Unit::TestCase
8
+ def setup
9
+ @controller = FeedController.new
10
+ @request = ActionController::TestRequest.new
11
+ @response = ActionController::TestResponse.new
12
+ end
13
+
14
+ # Replace this with your real tests.
15
+ def test_truth
16
+ assert true
17
+ end
18
+ end
@@ -0,0 +1,26 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+
3
+ # Expand the path to environment so that Ruby does not load it multiple times
4
+ # File.expand_path can be removed if Ruby 1.9 is in use.
5
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
6
+ require 'application'
7
+
8
+ require 'test/unit'
9
+ require 'active_record/fixtures'
10
+ require 'action_controller/test_process'
11
+ require 'action_web_service/test_invoke'
12
+ require 'breakpoint'
13
+
14
+ Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/"
15
+
16
+ class Test::Unit::TestCase
17
+ # Turn these on to use transactional fixtures with table_name(:fixture_name) instantiation of fixtures
18
+ # self.use_transactional_fixtures = true
19
+ # self.use_instantiated_fixtures = false
20
+
21
+ def create_fixtures(*table_names)
22
+ Fixtures.create_fixtures(File.dirname(__FILE__) + "/fixtures", table_names)
23
+ end
24
+
25
+ # Add more helper methods to be used by all tests here...
26
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.10
3
+ specification_version: 1
4
+ name: feedreader
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.2.3
7
+ date: 2005-08-11
8
+ summary: Example rails project for use with the FeedTools library.
9
+ require_paths:
10
+ - "."
11
+ email: bob@sporkmonger.com
12
+ homepage: http://sporkmonger.com/projects/feedtools
13
+ rubyforge_project: feedreader
14
+ description:
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: false
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ -
22
+ - ">"
23
+ - !ruby/object:Gem::Version
24
+ version: 0.0.0
25
+ version:
26
+ platform: ruby
27
+ authors:
28
+ - Bob Aman
29
+ files:
30
+ - app
31
+ - CHANGELOG
32
+ - components
33
+ - config
34
+ - db
35
+ - doc
36
+ - lib
37
+ - log
38
+ - public
39
+ - Rakefile
40
+ - README
41
+ - script
42
+ - test
43
+ - vendor
44
+ - app/apis
45
+ - app/controllers
46
+ - app/helpers
47
+ - app/models
48
+ - app/views
49
+ - app/controllers/application.rb
50
+ - app/controllers/feed_controller.rb
51
+ - app/helpers/application_helper.rb
52
+ - app/helpers/feed_helper.rb
53
+ - app/views/feed
54
+ - app/views/layouts
55
+ - app/views/feed/index.rhtml
56
+ - app/views/feed/view.rhtml
57
+ - app/views/feed/xml.rxml
58
+ - app/views/layouts/common.rhtml
59
+ - config/database.yml
60
+ - config/environment.rb
61
+ - config/environments
62
+ - config/routes.rb
63
+ - config/environments/development.rb
64
+ - config/environments/production.rb
65
+ - config/environments/test.rb
66
+ - db/development_structure.sql
67
+ - doc/README_FOR_APP
68
+ - public/404.html
69
+ - public/500.html
70
+ - public/dispatch.cgi
71
+ - public/dispatch.fcgi
72
+ - public/dispatch.rb
73
+ - public/favicon.ico
74
+ - public/images
75
+ - public/javascripts
76
+ - public/stylesheets
77
+ - public/javascripts/controls.js
78
+ - public/javascripts/dragdrop.js
79
+ - public/javascripts/effects.js
80
+ - public/javascripts/prototype.js
81
+ - script/benchmarker
82
+ - script/breakpointer
83
+ - script/console
84
+ - script/destroy
85
+ - script/generate
86
+ - script/profiler
87
+ - script/runner
88
+ - script/server
89
+ - test/fixtures
90
+ - test/functional
91
+ - test/mocks
92
+ - test/test_helper.rb
93
+ - test/unit
94
+ - test/functional/feed_controller_test.rb
95
+ - test/mocks/development
96
+ - test/mocks/test
97
+ - public/.htaccess
98
+ test_files: []
99
+ rdoc_options: []
100
+ extra_rdoc_files: []
101
+ executables: []
102
+ extensions: []
103
+ requirements: []
104
+ dependencies: []