technomancy-harker 0.0.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.
Files changed (63) hide show
  1. data/History.txt +12 -0
  2. data/Manifest.txt +64 -0
  3. data/README.rdoc +65 -0
  4. data/Rakefile +16 -0
  5. data/bin/harker +19 -0
  6. data/lib/harker/gemify.rb +40 -0
  7. data/lib/harker/rails_configuration.rb +27 -0
  8. data/lib/harker/server.rb +119 -0
  9. data/lib/harker.rb +105 -0
  10. data/test/sample/Manifest.txt +53 -0
  11. data/test/sample/README.rdoc +46 -0
  12. data/test/sample/Rakefile +16 -0
  13. data/test/sample/app/controllers/application_controller.rb +10 -0
  14. data/test/sample/app/controllers/harks_controller.rb +6 -0
  15. data/test/sample/app/helpers/application_helper.rb +3 -0
  16. data/test/sample/app/helpers/harks_helper.rb +2 -0
  17. data/test/sample/app/models/hark.rb +2 -0
  18. data/test/sample/bin/sample_rails +5 -0
  19. data/test/sample/config/boot.rb +110 -0
  20. data/test/sample/config/database.yml +22 -0
  21. data/test/sample/config/environment.rb +41 -0
  22. data/test/sample/config/environments/development.rb +17 -0
  23. data/test/sample/config/environments/production.rb +28 -0
  24. data/test/sample/config/environments/test.rb +28 -0
  25. data/test/sample/config/initializers/backtrace_silencers.rb +7 -0
  26. data/test/sample/config/initializers/inflections.rb +10 -0
  27. data/test/sample/config/initializers/mime_types.rb +5 -0
  28. data/test/sample/config/initializers/new_rails_defaults.rb +19 -0
  29. data/test/sample/config/initializers/session_store.rb +15 -0
  30. data/test/sample/config/locales/en.yml +5 -0
  31. data/test/sample/config/routes.rb +45 -0
  32. data/test/sample/db/migrate/20090326050232_create_harks.rb +12 -0
  33. data/test/sample/lib/sample_rails.rb +2 -0
  34. data/test/sample/public/404.html +30 -0
  35. data/test/sample/public/422.html +30 -0
  36. data/test/sample/public/500.html +30 -0
  37. data/test/sample/public/favicon.ico +0 -0
  38. data/test/sample/public/images/rails.png +0 -0
  39. data/test/sample/public/index.html +275 -0
  40. data/test/sample/public/javascripts/application.js +2 -0
  41. data/test/sample/public/javascripts/controls.js +963 -0
  42. data/test/sample/public/javascripts/dragdrop.js +973 -0
  43. data/test/sample/public/javascripts/effects.js +1128 -0
  44. data/test/sample/public/javascripts/prototype.js +4320 -0
  45. data/test/sample/public/robots.txt +5 -0
  46. data/test/sample/script/about +4 -0
  47. data/test/sample/script/console +3 -0
  48. data/test/sample/script/dbconsole +3 -0
  49. data/test/sample/script/destroy +3 -0
  50. data/test/sample/script/generate +3 -0
  51. data/test/sample/script/performance/benchmarker +3 -0
  52. data/test/sample/script/performance/profiler +3 -0
  53. data/test/sample/script/plugin +3 -0
  54. data/test/sample/script/runner +3 -0
  55. data/test/sample/script/server +3 -0
  56. data/test/sample/test/fixtures/harks.yml +7 -0
  57. data/test/sample/test/functional/harks_controller_test.rb +8 -0
  58. data/test/sample/test/performance/browsing_test.rb +9 -0
  59. data/test/sample/test/test_helper.rb +38 -0
  60. data/test/sample/test/unit/hark_test.rb +8 -0
  61. data/test/sample/test/unit/helpers/harks_helper_test.rb +4 -0
  62. data/test/test_harker.rb +83 -0
  63. metadata +159 -0
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+
3
+ # one:
4
+ # column: value
5
+ #
6
+ # two:
7
+ # column: value
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class HarksControllerTest < ActionController::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+ require 'performance_test_help'
3
+
4
+ # Profiling results for each test method are written to tmp/performance.
5
+ class BrowsingTest < ActionController::PerformanceTest
6
+ def test_homepage
7
+ get '/'
8
+ end
9
+ end
@@ -0,0 +1,38 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
+ require 'test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Transactional fixtures accelerate your tests by wrapping each test method
7
+ # in a transaction that's rolled back on completion. This ensures that the
8
+ # test database remains unchanged so your fixtures don't have to be reloaded
9
+ # between every test method. Fewer database queries means faster tests.
10
+ #
11
+ # Read Mike Clark's excellent walkthrough at
12
+ # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
+ #
14
+ # Every Active Record database supports transactions except MyISAM tables
15
+ # in MySQL. Turn off transactional fixtures in this case; however, if you
16
+ # don't care one way or the other, switching from MyISAM to InnoDB tables
17
+ # is recommended.
18
+ #
19
+ # The only drawback to using transactional fixtures is when you actually
20
+ # need to test transactions. Since your test is bracketed by a transaction,
21
+ # any transactions started in your code will be automatically rolled back.
22
+ self.use_transactional_fixtures = true
23
+
24
+ # Instantiated fixtures are slow, but give you @david where otherwise you
25
+ # would need people(:david). If you don't want to migrate your existing
26
+ # test cases which use the @david style and don't mind the speed hit (each
27
+ # instantiated fixtures translates to a database query per test method),
28
+ # then set this back to true.
29
+ self.use_instantiated_fixtures = false
30
+
31
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
+ #
33
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
+ # -- they do not yet inherit this setting
35
+ fixtures :all
36
+
37
+ # Add more helper methods to be used by all tests here...
38
+ end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class HarkTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ test "the truth" do
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class HarksHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,83 @@
1
+ require "rubygems"
2
+ require "minitest/unit"
3
+ require 'fileutils'
4
+ require 'open-uri'
5
+
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + "/../lib/")
7
+ require 'harker'
8
+
9
+ begin
10
+ ENV['RAILS_ENV'] = 'production'
11
+ gem 'sample_rails'
12
+ rescue LoadError
13
+ abort "You need the sample_rails gem installed:
14
+ $ cd #{File.dirname(__FILE__) + '/sample'} && rake install_gem"
15
+ end
16
+
17
+ class TestHarker < MiniTest::Unit::TestCase
18
+ ROOT = "/tmp/harker-test-#{Process.pid}"
19
+ URL = 'http://localhost:3000/harks'
20
+
21
+ # Ensure nothing's currently running on that port
22
+ begin
23
+ open(URL).read and abort "Already a process running on our port."
24
+ rescue Errno::ECONNREFUSED # We want this to happen
25
+ end
26
+
27
+ def setup
28
+ unless File.exist?(ROOT)
29
+ harker_action('init')
30
+ harker_action('migrate')
31
+ end
32
+ end
33
+
34
+ at_exit { FileUtils.rm_rf ROOT }
35
+
36
+ def test_init
37
+ assert File.exist?(ROOT)
38
+ assert File.exist?(ROOT + '/database.yml')
39
+ end
40
+
41
+ def test_start
42
+ start_server_process
43
+ harks = YAML.load(open(URL).read)
44
+ assert File.exists?(ROOT + '/tmp/pids/server.pid'), "No pid found."
45
+ # Make sure actual DB access works.
46
+ assert_equal ['Joy!'], harks.map{ |h| h['tidings'] }
47
+ ensure
48
+ begin
49
+ harker_action('stop')
50
+ rescue SystemExit
51
+ end
52
+ end
53
+
54
+ def test_stop
55
+ start_server_process
56
+ assert File.exists?(ROOT + '/tmp/pids/server.pid'), "No pid found."
57
+ Harker.launch('sample_rails', ['stop', ROOT])
58
+ assert_raises(Errno::ECONNREFUSED) { open(URL).read }
59
+ end
60
+
61
+ def test_migrate
62
+ assert_equal(['id', 'tidings', 'updated_at', 'created_at'].sort,
63
+ Hark.columns.map{ |c| c.name }.sort)
64
+ end
65
+
66
+ private
67
+
68
+ def harker_action(action)
69
+ $stdout = StringIO.new
70
+ $stderr = StringIO.new
71
+ Harker.launch('sample_rails', [action, ROOT])
72
+ ensure
73
+ $stdout = STDOUT
74
+ $stderr = STDERR
75
+ end
76
+
77
+ def start_server_process
78
+ `cd #{File.dirname(__FILE__)}/.. ; ruby -I:lib test/sample/bin/sample_rails #{ROOT} start`
79
+ loop { break if File.exist?(ROOT + '/tmp/pids/server.pid'); sleep 0.1 }
80
+ end
81
+ end
82
+
83
+ MiniTest::Unit.autorun
metadata ADDED
@@ -0,0 +1,159 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: technomancy-harker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Phil Hagelberg
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-03-26 00:00:00 -07:00
13
+ default_executable: harker
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 2.3.2
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: minitest
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.1
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: sqlite3-ruby
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 1.2.4
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: hoe
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 1.11.0
54
+ version:
55
+ description: Harker means Rails deployments via RubyGems--because a package manager is a terrible thing to waste.
56
+ email:
57
+ - technomancy@gmail.com
58
+ executables:
59
+ - harker
60
+ extensions: []
61
+
62
+ extra_rdoc_files:
63
+ - History.txt
64
+ - Manifest.txt
65
+ files:
66
+ - History.txt
67
+ - Manifest.txt
68
+ - README.rdoc
69
+ - Rakefile
70
+ - bin/harker
71
+ - lib/harker.rb
72
+ - lib/harker/gemify.rb
73
+ - lib/harker/rails_configuration.rb
74
+ - lib/harker/server.rb
75
+ - test/sample/Manifest.txt
76
+ - test/sample/README.rdoc
77
+ - test/sample/Rakefile
78
+ - test/sample/app/controllers/application_controller.rb
79
+ - test/sample/app/controllers/harks_controller.rb
80
+ - test/sample/app/helpers/application_helper.rb
81
+ - test/sample/app/helpers/harks_helper.rb
82
+ - test/sample/app/models/hark.rb
83
+ - test/sample/bin/sample_rails
84
+ - test/sample/config/boot.rb
85
+ - test/sample/config/database.yml
86
+ - test/sample/config/environment.rb
87
+ - test/sample/config/environments/development.rb
88
+ - test/sample/config/environments/production.rb
89
+ - test/sample/config/environments/test.rb
90
+ - test/sample/config/initializers/backtrace_silencers.rb
91
+ - test/sample/config/initializers/inflections.rb
92
+ - test/sample/config/initializers/mime_types.rb
93
+ - test/sample/config/initializers/new_rails_defaults.rb
94
+ - test/sample/config/initializers/session_store.rb
95
+ - test/sample/config/locales/en.yml
96
+ - test/sample/config/routes.rb
97
+ - test/sample/db/migrate/20090326050232_create_harks.rb
98
+ - test/sample/lib/sample_rails.rb
99
+ - test/sample/log/development.log
100
+ - test/sample/log/test.log
101
+ - test/sample/public/404.html
102
+ - test/sample/public/422.html
103
+ - test/sample/public/500.html
104
+ - test/sample/public/favicon.ico
105
+ - test/sample/public/images/rails.png
106
+ - test/sample/public/index.html
107
+ - test/sample/public/javascripts/application.js
108
+ - test/sample/public/javascripts/controls.js
109
+ - test/sample/public/javascripts/dragdrop.js
110
+ - test/sample/public/javascripts/effects.js
111
+ - test/sample/public/javascripts/prototype.js
112
+ - test/sample/public/robots.txt
113
+ - test/sample/script/about
114
+ - test/sample/script/console
115
+ - test/sample/script/dbconsole
116
+ - test/sample/script/destroy
117
+ - test/sample/script/generate
118
+ - test/sample/script/performance/benchmarker
119
+ - test/sample/script/performance/profiler
120
+ - test/sample/script/plugin
121
+ - test/sample/script/runner
122
+ - test/sample/script/server
123
+ - test/sample/test/fixtures/harks.yml
124
+ - test/sample/test/functional/harks_controller_test.rb
125
+ - test/sample/test/performance/browsing_test.rb
126
+ - test/sample/test/test_helper.rb
127
+ - test/sample/test/unit/hark_test.rb
128
+ - test/sample/test/unit/helpers/harks_helper_test.rb
129
+ - test/test_harker.rb
130
+ has_rdoc: true
131
+ homepage: http://github.com/technomancy/harker
132
+ post_install_message:
133
+ rdoc_options:
134
+ - --main
135
+ - README.rdoc
136
+ require_paths:
137
+ - lib
138
+ required_ruby_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: "0"
143
+ version:
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: "0"
149
+ version:
150
+ requirements: []
151
+
152
+ rubyforge_project: harker
153
+ rubygems_version: 1.2.0
154
+ signing_key:
155
+ specification_version: 3
156
+ summary: Concourse is a tool to make planning gatherings easy.
157
+ test_files:
158
+ - test/sample/test/test_helper.rb
159
+ - test/test_harker.rb