pineapple 1.0.1 → 1.1.0
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.
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/lib/generators/pineapple/install_generator.rb +4 -1
- data/lib/generators/pineapple/templates/app/controllers/pineapple_controller.rb +3 -1
- data/lib/generators/pineapple/templates/app/controllers/pineapple_steps_controller.rb +90 -0
- data/lib/generators/pineapple/templates/app/views/pineapple_steps/_form.html.erb +25 -0
- data/lib/generators/pineapple/templates/app/views/pineapple_steps/edit.html.erb +6 -0
- data/lib/generators/pineapple/templates/app/views/pineapple_steps/index.html.erb +25 -0
- data/lib/generators/pineapple/templates/app/views/pineapple_steps/new.html.erb +5 -0
- data/lib/generators/pineapple/templates/app/views/pineapple_steps/show.html.erb +15 -0
- data/lib/pineapple/actions/check.rb +1 -4
- data/lib/pineapple/actions/choose.rb +1 -1
- data/lib/pineapple/actions/click_button.rb +1 -1
- data/lib/pineapple/actions/click_link.rb +1 -1
- data/lib/pineapple/actions/fill_in.rb +1 -1
- data/lib/pineapple/actions/script.rb +0 -1
- data/lib/pineapple/actions/select.rb +1 -1
- data/lib/pineapple/actions/uncheck.rb +1 -4
- data/lib/pineapple/actions/visit.rb +1 -1
- data/lib/pineapple/translator.rb +3 -8
- metadata +62 -48
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -14,7 +14,9 @@ class PineappleController < ApplicationController
|
|
14
14
|
current_step = params['init']
|
15
15
|
end
|
16
16
|
unless current_step.nil?
|
17
|
-
|
17
|
+
pineapple_step = PineappleStep.find_by_name current_step
|
18
|
+
step_body = pineapple_step.body
|
19
|
+
translator = PineappleTranslator.new(step_body)
|
18
20
|
translator.translate
|
19
21
|
session[:next_step] = translator.next_s
|
20
22
|
puts "next step = #{translator.next_s}"
|
@@ -0,0 +1,90 @@
|
|
1
|
+
class PineappleStepsController < ApplicationController
|
2
|
+
# GET /pineapple_steps
|
3
|
+
# GET /pineapple_steps.xml
|
4
|
+
def index
|
5
|
+
@pineapple_steps = PineappleStep.all
|
6
|
+
|
7
|
+
respond_to do |format|
|
8
|
+
format.html # index.html.erb
|
9
|
+
format.xml { render :xml => @pineapple_steps }
|
10
|
+
format.json{
|
11
|
+
render :json => @pineapple_steps.to_json
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /pineapple_steps/1
|
17
|
+
# GET /pineapple_steps/1.xml
|
18
|
+
def show
|
19
|
+
@pineapple_step = PineappleStep.find(params[:id])
|
20
|
+
|
21
|
+
respond_to do |format|
|
22
|
+
format.html # show.html.erb
|
23
|
+
format.xml { render :xml => @pineapple_step }
|
24
|
+
format.json{
|
25
|
+
render :json => @pineapple_step.to_json
|
26
|
+
}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# GET /pineapple_steps/new
|
31
|
+
# GET /pineapple_steps/new.xml
|
32
|
+
def new
|
33
|
+
@pineapple_step = PineappleStep.new
|
34
|
+
|
35
|
+
respond_to do |format|
|
36
|
+
format.html # new.html.erb
|
37
|
+
format.xml { render :xml => @pineapple_step }
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# GET /pineapple_steps/1/edit
|
43
|
+
def edit
|
44
|
+
@pineapple_step = PineappleStep.find(params[:id])
|
45
|
+
end
|
46
|
+
|
47
|
+
# POST /pineapple_steps
|
48
|
+
# POST /pineapple_steps.xml
|
49
|
+
def create
|
50
|
+
@pineapple_step = PineappleStep.new(params[:pineapple_step])
|
51
|
+
|
52
|
+
respond_to do |format|
|
53
|
+
if @pineapple_step.save
|
54
|
+
format.html { redirect_to(@pineapple_step, :notice => 'Pineapple step was successfully created.') }
|
55
|
+
format.xml { render :xml => @pineapple_step, :status => :created, :location => @pineapple_step }
|
56
|
+
else
|
57
|
+
format.html { render :action => "new" }
|
58
|
+
format.xml { render :xml => @pineapple_step.errors, :status => :unprocessable_entity }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# PUT /pineapple_steps/1
|
64
|
+
# PUT /pineapple_steps/1.xml
|
65
|
+
def update
|
66
|
+
@pineapple_step = PineappleStep.find(params[:id])
|
67
|
+
|
68
|
+
respond_to do |format|
|
69
|
+
if @pineapple_step.update_attributes(params[:pineapple_step])
|
70
|
+
format.html { redirect_to(@pineapple_step, :notice => 'Pineapple step was successfully updated.') }
|
71
|
+
format.xml { head :ok }
|
72
|
+
else
|
73
|
+
format.html { render :action => "edit" }
|
74
|
+
format.xml { render :xml => @pineapple_step.errors, :status => :unprocessable_entity }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# DELETE /pineapple_steps/1
|
80
|
+
# DELETE /pineapple_steps/1.xml
|
81
|
+
def destroy
|
82
|
+
@pineapple_step = PineappleStep.find(params[:id])
|
83
|
+
@pineapple_step.destroy
|
84
|
+
|
85
|
+
respond_to do |format|
|
86
|
+
format.html { redirect_to(pineapple_steps_url) }
|
87
|
+
format.xml { head :ok }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= form_for(@pineapple_step) do |f| %>
|
2
|
+
<% if @pineapple_step.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@pineapple_step.errors.count, "error") %> prohibited this pineapple_step from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @pineapple_step.errors.full_messages.each do |msg| %>
|
8
|
+
<li><%= msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :name %><br />
|
16
|
+
<%= f.text_field :name %>
|
17
|
+
</div>
|
18
|
+
<div class="field">
|
19
|
+
<%= f.label :body %><br />
|
20
|
+
<%= f.text_area :body %>
|
21
|
+
</div>
|
22
|
+
<div class="actions">
|
23
|
+
<%= f.submit %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<h1>Listing pineapple_steps</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th>Name</th>
|
6
|
+
<th>Body</th>
|
7
|
+
<th></th>
|
8
|
+
<th></th>
|
9
|
+
<th></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<% @pineapple_steps.each do |pineapple_step| %>
|
13
|
+
<tr>
|
14
|
+
<td><%= pineapple_step.name %></td>
|
15
|
+
<td><%= pineapple_step.body %></td>
|
16
|
+
<td><%= link_to 'Show', pineapple_step %></td>
|
17
|
+
<td><%= link_to 'Edit', edit_pineapple_step_path(pineapple_step) %></td>
|
18
|
+
<td><%= link_to 'Destroy', pineapple_step, :confirm => 'Are you sure?', :method => :delete %></td>
|
19
|
+
</tr>
|
20
|
+
<% end %>
|
21
|
+
</table>
|
22
|
+
|
23
|
+
<br />
|
24
|
+
|
25
|
+
<%= link_to 'New Pineapple step', new_pineapple_step_path %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<b>Name:</b>
|
5
|
+
<%= @pineapple_step.name %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<b>Body:</b>
|
10
|
+
<%= @pineapple_step.body %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
|
14
|
+
<%= link_to 'Edit', edit_pineapple_step_path(@pineapple_step) %> |
|
15
|
+
<%= link_to 'Back', pineapple_steps_path %>
|
data/lib/pineapple/translator.rb
CHANGED
@@ -7,20 +7,15 @@ class PineappleTranslator
|
|
7
7
|
|
8
8
|
attr_accessor :next_s, :script
|
9
9
|
|
10
|
-
def initialize(
|
10
|
+
def initialize(step_body)
|
11
11
|
@script= ""
|
12
12
|
|
13
|
-
steps_root_path = ENV['PINEAPPLE_STEPS_PATH']
|
14
|
-
if steps_root_path.nil? || steps_root_path.empty?
|
15
|
-
steps_root_path = "#{Rails.root}/pineapple/steps/"
|
16
|
-
end
|
17
13
|
|
18
|
-
@
|
19
|
-
@step_body = load_step
|
14
|
+
@step_body = step_body
|
20
15
|
end
|
21
16
|
|
22
17
|
def translate
|
23
|
-
instance_eval @step_body
|
18
|
+
instance_eval @step_body
|
24
19
|
end
|
25
20
|
|
26
21
|
private
|
metadata
CHANGED
@@ -1,68 +1,82 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: pineapple
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 1.1.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
- Reza Alavi
|
9
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- Reza Alavi
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
date: 2011-06-02 00:00:00 +10:00
|
14
|
+
default_executable:
|
14
15
|
dependencies: []
|
16
|
+
|
15
17
|
description: An automation testing framework.
|
16
18
|
email: rezaalavi@rubyforge.org
|
17
19
|
executables: []
|
20
|
+
|
18
21
|
extensions: []
|
19
|
-
|
20
|
-
|
21
|
-
-
|
22
|
-
|
23
|
-
|
24
|
-
-
|
25
|
-
-
|
26
|
-
-
|
27
|
-
- lib/generators/pineapple/
|
28
|
-
- lib/generators/pineapple/templates/app/
|
29
|
-
- lib/pineapple/
|
30
|
-
- lib/pineapple/
|
31
|
-
- lib/pineapple/
|
32
|
-
- lib/pineapple/
|
33
|
-
- lib/pineapple/
|
34
|
-
- lib/pineapple/
|
35
|
-
- lib/pineapple/
|
36
|
-
- lib/pineapple/actions
|
37
|
-
- lib/pineapple/
|
38
|
-
- lib/pineapple/
|
39
|
-
- lib/pineapple/actions.rb
|
40
|
-
- lib/pineapple/
|
41
|
-
- lib/pineapple/
|
42
|
-
- lib/pineapple/
|
22
|
+
|
23
|
+
extra_rdoc_files:
|
24
|
+
- README.rdoc
|
25
|
+
- LICENSE
|
26
|
+
files:
|
27
|
+
- LICENSE
|
28
|
+
- README.rdoc
|
29
|
+
- Rakefile
|
30
|
+
- lib/generators/pineapple/install_generator.rb
|
31
|
+
- lib/generators/pineapple/templates/app/controllers/pineapple_controller.rb
|
32
|
+
- lib/generators/pineapple/templates/app/controllers/pineapple_steps_controller.rb
|
33
|
+
- lib/generators/pineapple/templates/app/views/pineapple/show.html.erb
|
34
|
+
- lib/generators/pineapple/templates/app/views/pineapple_steps/edit.html.erb
|
35
|
+
- lib/generators/pineapple/templates/app/views/pineapple_steps/index.html.erb
|
36
|
+
- lib/generators/pineapple/templates/app/views/pineapple_steps/new.html.erb
|
37
|
+
- lib/generators/pineapple/templates/app/views/pineapple_steps/show.html.erb
|
38
|
+
- lib/generators/pineapple/templates/app/views/pineapple_steps/_form.html.erb
|
39
|
+
- lib/pineapple/actions.rb
|
40
|
+
- lib/pineapple/translator.rb
|
41
|
+
- lib/pineapple/utils.rb
|
42
|
+
- lib/pineapple/actions/check.rb
|
43
|
+
- lib/pineapple/actions/choose.rb
|
44
|
+
- lib/pineapple/actions/click_button.rb
|
45
|
+
- lib/pineapple/actions/click_link.rb
|
46
|
+
- lib/pineapple/actions/click_on.rb
|
47
|
+
- lib/pineapple/actions/fill_in.rb
|
48
|
+
- lib/pineapple/actions/script.rb
|
49
|
+
- lib/pineapple/actions/select.rb
|
50
|
+
- lib/pineapple/actions/uncheck.rb
|
51
|
+
- lib/pineapple/actions/visit.rb
|
52
|
+
- lib/pineapple/utils/global_selector.rb
|
43
53
|
has_rdoc: true
|
44
54
|
homepage: http://github.com/rezaalavi/pineapple
|
45
55
|
licenses: []
|
46
|
-
|
56
|
+
|
57
|
+
post_install_message:
|
47
58
|
rdoc_options: []
|
48
|
-
|
49
|
-
|
50
|
-
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
63
|
none: false
|
52
|
-
requirements:
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0"
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
69
|
none: false
|
58
|
-
requirements:
|
59
|
-
|
60
|
-
|
61
|
-
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
62
74
|
requirements: []
|
63
|
-
|
75
|
+
|
76
|
+
rubyforge_project:
|
64
77
|
rubygems_version: 1.5.0
|
65
|
-
signing_key:
|
78
|
+
signing_key:
|
66
79
|
specification_version: 3
|
67
80
|
summary: An automation testing framework.
|
68
81
|
test_files: []
|
82
|
+
|