cucumba 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ log/*
2
+ vendor/*
3
+ tmp/*
4
+ *.sqlite3
5
+ config/cucumba.yml
6
+ script/cucumba
@@ -1,11 +1,11 @@
1
1
  #!/bin/sh
2
2
 
3
3
  sudo gem uninstall cucumba
4
- rake install_gem_no_doc
4
+ sudo rake install
5
5
 
6
6
  SAMPLE_APP_PATH=`dirname $0`/sample_app
7
7
  echo "(in $SAMPLE_APP_PATH)"
8
8
  cd $SAMPLE_APP_PATH
9
9
  ./script/generate cucumba -f test
10
- rake db:reset
10
+ rake db:setup RAILS_ENV=test
11
11
  ./script/cucumba
@@ -1,26 +1,14 @@
1
- begin
2
- require 'rubygems' unless ENV['NO_RUBYGEMS']
3
- require 'spec'
4
- require 'spec/rake/spectask'
5
- rescue LoadError
6
- puts <<-EOS
7
- To use rspec for testing you must install rspec gem:
8
- gem install rspec
9
- EOS
10
- exit(0)
11
- end
12
-
13
- namespace :spec do
1
+ require 'spec'
2
+ require 'spec/rake/spectask'
14
3
 
15
- desc "Run the specs for configuration"
16
- Spec::Rake::SpecTask.new(:config) do |t|
17
- t.spec_opts = ['--options', "spec/spec.opts"]
18
- t.spec_files = FileList['spec/*_spec.rb']
19
- end
4
+ unless File.exists?('.spec/spec.opts')
5
+ Dir.mkdir('.spec') unless File.exists?('.spec')
6
+ File.open('.spec/spec.opts','w') { |f| f.write('--color') }
7
+ end
20
8
 
21
- desc "Run the specs with running test rails app"
22
- Spec::Rake::SpecTask.new(:rails) do |t|
23
- t.spec_opts = ['--options', "spec/spec.opts"]
24
- t.spec_files = FileList['spec/*_spec_rails.rb']
25
- end
9
+ Spec::Rake::SpecTask.new do |t|
10
+ t.spec_opts = ['--options', ".spec/spec.opts"]
11
+ t.spec_files = FileList['spec/configuration_spec.rb','spec/rails_spec.rb']
26
12
  end
13
+
14
+ task :default => :spec
@@ -0,0 +1,4 @@
1
+ desc "Cleanup"
2
+ task :clean do
3
+ FileUtils.rm_rf(['pkg','doc','.yardoc'])
4
+ end
@@ -1,14 +1,5 @@
1
- begin
2
- require 'rubygems' unless ENV['NO_RUBYGEMS']
3
- require 'yard'
4
- require 'yard/rake/yardoc_task'
5
- rescue LoadError
6
- puts <<-EOS
7
- To use Yard for generating documentation you must install yard gem:
8
- gem install yard
9
- EOS
10
- exit(0)
11
- end
1
+ require 'yard'
2
+ require 'yard/rake/yardoc_task'
12
3
  YARD::Rake::YardocTask.new do |t|
13
- t.files = ['lib/**/*.rb', '-',$hoe.history_file]
4
+ t.files = ['lib/**/*.rb', '-','History.md']
14
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumba
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - kucaahbe
@@ -15,127 +15,27 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-04 00:00:00 +03:00
18
+ date: 2010-10-05 00:00:00 +03:00
19
19
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: yard
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 5
30
- segments:
31
- - 0
32
- - 6
33
- - 1
34
- version: 0.6.1
35
- type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: bluecloth
39
- prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - "="
44
- - !ruby/object:Gem::Version
45
- hash: 29
46
- segments:
47
- - 2
48
- - 0
49
- - 9
50
- version: 2.0.9
51
- type: :development
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: rails
55
- prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - "="
60
- - !ruby/object:Gem::Version
61
- hash: 19
62
- segments:
63
- - 2
64
- - 3
65
- - 8
66
- version: 2.3.8
67
- type: :development
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: sqlite3-ruby
71
- prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - "="
76
- - !ruby/object:Gem::Version
77
- hash: 25
78
- segments:
79
- - 1
80
- - 3
81
- - 1
82
- version: 1.3.1
83
- type: :development
84
- version_requirements: *id004
85
- - !ruby/object:Gem::Dependency
86
- name: rspec
87
- prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - "="
92
- - !ruby/object:Gem::Version
93
- hash: 27
94
- segments:
95
- - 1
96
- - 3
97
- - 0
98
- version: 1.3.0
99
- type: :development
100
- version_requirements: *id005
101
- - !ruby/object:Gem::Dependency
102
- name: hoe
103
- prerelease: false
104
- requirement: &id006 !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- hash: 19
110
- segments:
111
- - 2
112
- - 6
113
- - 2
114
- version: 2.6.2
115
- type: :development
116
- version_requirements: *id006
117
- description: |-
118
- If you develop more than one rails applications
119
- that communicate with each other and you need to test them
120
- with something like capybara and also whant to communicate with database -
121
- this gem will help you
20
+ dependencies: []
21
+
22
+ description: If you develop more than one rails applications that communicate with each other and you need to test them with something like capybara and also whant to communicate with database - this gem will help you
122
23
  email:
123
24
  - kucaahbe@ukr.net
124
25
  executables: []
125
26
 
126
27
  extensions: []
127
28
 
128
- extra_rdoc_files:
129
- - Manifest.txt
130
- - PostInstall.txt
131
- - website/index.txt
29
+ extra_rdoc_files: []
30
+
132
31
  files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - Gemfile.lock
133
35
  - History.md
134
- - Manifest.txt
135
36
  - PostInstall.txt
136
37
  - README.rdoc
137
38
  - Rakefile
138
- - config/website.yml.sample
139
39
  - cucumba.gemspec
140
40
  - generators/cucumba/USAGE
141
41
  - generators/cucumba/cucumba_generator.rb
@@ -143,18 +43,15 @@ files:
143
43
  - generators/cucumba/templates/cucumba
144
44
  - lib/cucumba.rb
145
45
  - lib/cucumba/drb.rb
146
- - lib/cucumba/rails.rb
147
- - lib/cucumba/rails/model.rb
148
- - lib/cucumba/rails/runner.rb
46
+ - lib/cucumba/railz.rb
47
+ - lib/cucumba/railz/klass.rb
48
+ - lib/cucumba/railz/runner.rb
149
49
  - lib/cucumba/server.rb
150
- - script/console
151
- - script/destroy
152
- - script/generate
153
- - script/txt2html
154
- - spec/cucumba_configuration_spec.rb
155
- - spec/cucumba_spec_rails.rb
156
- - spec/spec.opts
50
+ - lib/cucumba/version.rb
51
+ - spec/configuration_spec.rb
52
+ - spec/rails_spec.rb
157
53
  - spec/spec_helper.rb
54
+ - spec/support/sample_app/.gitignore
158
55
  - spec/support/sample_app/README
159
56
  - spec/support/sample_app/Rakefile
160
57
  - spec/support/sample_app/app/controllers/application_controller.rb
@@ -203,20 +100,15 @@ files:
203
100
  - spec/support/sample_app/script/server
204
101
  - spec/support/sample_app_run.sh
205
102
  - tasks/rspec.rake
103
+ - tasks/utils.rake
206
104
  - tasks/yard.rake
207
- - website/index.html
208
- - website/index.txt
209
- - website/javascripts/rounded_corners_lite.inc.js
210
- - website/stylesheets/screen.css
211
- - website/template.html.erb
212
105
  has_rdoc: true
213
106
  homepage: http://github.com/hxcoding/cucumba
214
107
  licenses: []
215
108
 
216
109
  post_install_message: PostInstall.txt
217
- rdoc_options:
218
- - --main
219
- - README.rdoc
110
+ rdoc_options: []
111
+
220
112
  require_paths:
221
113
  - lib
222
114
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -1,79 +0,0 @@
1
- History.md
2
- Manifest.txt
3
- PostInstall.txt
4
- README.rdoc
5
- Rakefile
6
- config/website.yml.sample
7
- cucumba.gemspec
8
- generators/cucumba/USAGE
9
- generators/cucumba/cucumba_generator.rb
10
- generators/cucumba/templates/config.yml
11
- generators/cucumba/templates/cucumba
12
- lib/cucumba.rb
13
- lib/cucumba/drb.rb
14
- lib/cucumba/rails.rb
15
- lib/cucumba/rails/model.rb
16
- lib/cucumba/rails/runner.rb
17
- lib/cucumba/server.rb
18
- script/console
19
- script/destroy
20
- script/generate
21
- script/txt2html
22
- spec/cucumba_configuration_spec.rb
23
- spec/cucumba_spec_rails.rb
24
- spec/spec.opts
25
- spec/spec_helper.rb
26
- spec/support/sample_app/README
27
- spec/support/sample_app/Rakefile
28
- spec/support/sample_app/app/controllers/application_controller.rb
29
- spec/support/sample_app/app/controllers/users_controller.rb
30
- spec/support/sample_app/app/helpers/application_helper.rb
31
- spec/support/sample_app/app/helpers/users_helper.rb
32
- spec/support/sample_app/app/models/user.rb
33
- spec/support/sample_app/app/views/layouts/users.html.erb
34
- spec/support/sample_app/app/views/users/edit.html.erb
35
- spec/support/sample_app/app/views/users/index.html.erb
36
- spec/support/sample_app/app/views/users/new.html.erb
37
- spec/support/sample_app/app/views/users/show.html.erb
38
- spec/support/sample_app/config/boot.rb
39
- spec/support/sample_app/config/database.yml
40
- spec/support/sample_app/config/environment.rb
41
- spec/support/sample_app/config/environments/development.rb
42
- spec/support/sample_app/config/environments/production.rb
43
- spec/support/sample_app/config/environments/test.rb
44
- spec/support/sample_app/config/initializers/cookie_verification_secret.rb
45
- spec/support/sample_app/config/initializers/new_rails_defaults.rb
46
- spec/support/sample_app/config/initializers/session_store.rb
47
- spec/support/sample_app/config/routes.rb
48
- spec/support/sample_app/db/schema.rb
49
- spec/support/sample_app/public/404.html
50
- spec/support/sample_app/public/422.html
51
- spec/support/sample_app/public/500.html
52
- spec/support/sample_app/public/favicon.ico
53
- spec/support/sample_app/public/images/rails.png
54
- spec/support/sample_app/public/index.html
55
- spec/support/sample_app/public/javascripts/application.js
56
- spec/support/sample_app/public/javascripts/controls.js
57
- spec/support/sample_app/public/javascripts/dragdrop.js
58
- spec/support/sample_app/public/javascripts/effects.js
59
- spec/support/sample_app/public/javascripts/prototype.js
60
- spec/support/sample_app/public/robots.txt
61
- spec/support/sample_app/public/stylesheets/scaffold.css
62
- spec/support/sample_app/script/about
63
- spec/support/sample_app/script/console
64
- spec/support/sample_app/script/dbconsole
65
- spec/support/sample_app/script/destroy
66
- spec/support/sample_app/script/generate
67
- spec/support/sample_app/script/performance/benchmarker
68
- spec/support/sample_app/script/performance/profiler
69
- spec/support/sample_app/script/plugin
70
- spec/support/sample_app/script/runner
71
- spec/support/sample_app/script/server
72
- spec/support/sample_app_run.sh
73
- tasks/rspec.rake
74
- tasks/yard.rake
75
- website/index.html
76
- website/index.txt
77
- website/javascripts/rounded_corners_lite.inc.js
78
- website/stylesheets/screen.css
79
- website/template.html.erb
@@ -1,2 +0,0 @@
1
- host: unknown@rubyforge.org
2
- remote_dir: /var/www/gforge-projects/cucumba
@@ -1,26 +0,0 @@
1
- module Cucumba
2
- class Rails
3
- class Model
4
-
5
- class NotFoundError < Exception
6
- end
7
-
8
- def initialize(model_name,server)
9
- @server = server
10
- if @server.has_model?(model_name)
11
- @model = model_name
12
- else
13
- raise NotFoundError
14
- end
15
- end
16
-
17
- def method_missing(method,*args)
18
- if @server.model_has_method?(@model,method)
19
- @server.invoke_method_on_model(@model,method,args)
20
- else
21
- super
22
- end
23
- end
24
- end
25
- end
26
- end
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # File: script/console
3
- irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
-
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/cucumba.rb'}"
9
- puts "Loading cucumba gem"
10
- exec "#{irb} #{libs} --simple-prompt"
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- load File.dirname(__FILE__) + "/../Rakefile"
4
- require 'rubyforge'
5
- require 'redcloth'
6
- require 'syntax/convertors/html'
7
- require 'erb'
8
-
9
- download = "http://rubyforge.org/projects/#{$hoe.rubyforge_name}"
10
- version = $hoe.version
11
-
12
- def rubyforge_project_id
13
- RubyForge.new.configure.autoconfig["group_ids"][$hoe.rubyforge_name]
14
- end
15
-
16
- class Fixnum
17
- def ordinal
18
- # teens
19
- return 'th' if (10..19).include?(self % 100)
20
- # others
21
- case self % 10
22
- when 1: return 'st'
23
- when 2: return 'nd'
24
- when 3: return 'rd'
25
- else return 'th'
26
- end
27
- end
28
- end
29
-
30
- class Time
31
- def pretty
32
- return "#{mday}#{mday.ordinal} #{strftime('%B')} #{year}"
33
- end
34
- end
35
-
36
- def convert_syntax(syntax, source)
37
- return Syntax::Convertors::HTML.for_syntax(syntax).convert(source).gsub(%r!^<pre>|</pre>$!,'')
38
- end
39
-
40
- if ARGV.length >= 1
41
- src, template = ARGV
42
- template ||= File.join(File.dirname(__FILE__), '/../website/template.html.erb')
43
- else
44
- puts("Usage: #{File.split($0).last} source.txt [template.html.erb] > output.html")
45
- exit!
46
- end
47
-
48
- template = ERB.new(File.open(template).read)
49
-
50
- title = nil
51
- body = nil
52
- File.open(src) do |fsrc|
53
- title_text = fsrc.readline
54
- body_text_template = fsrc.read
55
- body_text = ERB.new(body_text_template).result(binding)
56
- syntax_items = []
57
- body_text.gsub!(%r!<(pre|code)[^>]*?syntax=['"]([^'"]+)[^>]*>(.*?)</\1>!m){
58
- ident = syntax_items.length
59
- element, syntax, source = $1, $2, $3
60
- syntax_items << "<#{element} class='syntax'>#{convert_syntax(syntax, source)}</#{element}>"
61
- "syntax-temp-#{ident}"
62
- }
63
- title = RedCloth.new(title_text).to_html.gsub(%r!<.*?>!,'').strip
64
- body = RedCloth.new(body_text).to_html
65
- body.gsub!(%r!(?:<pre><code>)?syntax-temp-(\d+)(?:</code></pre>)?!){ syntax_items[$1.to_i] }
66
- end
67
- stat = File.stat(src)
68
- created = stat.ctime
69
- modified = stat.mtime
70
-
71
- $stdout << template.result(binding)