swamp 0.0.1 → 0.0.5
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.
- checksums.yaml +4 -4
- data/.gitignore +19 -0
- data/Gemfile.lock +3 -3
- data/features/specifications/user_scans_a_page_interactively.feature +1 -0
- data/features/step_definitions/swamp_steps.rb +2 -2
- data/lib/swamp/interface.rb +3 -0
- data/lib/swamp/version.rb +2 -2
- data/lib/swamp.rb +0 -4
- data/spec/swamp/interface_spec.rb +5 -0
- data/swamp.gemspec +1 -1
- data/tags +124 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 993cf92bcfaa3382867df18783041d2da04a517e
|
4
|
+
data.tar.gz: faecff99b2d3b4fc43ec2efad2e91cc6a977787f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eb6c62269e4029422075d927bce3a92e56665011bb9ea00f474f41691404c05e20fda8e0c543c2a84d3af8723d8d937608cc6bfeac1dbece53472e75f626477
|
7
|
+
data.tar.gz: 569f961c77f1b411747f20f2d99180b5c19be26b41ce5c5549ee0a876b25ab282f0de1a1dc537df698e3177a554793e681f9320a668d15087fc1543b896f32a1
|
data/.gitignore
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
swamp (0.0.
|
4
|
+
swamp (0.0.4)
|
5
5
|
capybara
|
6
6
|
selenium-webdriver
|
7
7
|
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
ffi (1.9.0)
|
29
29
|
gherkin (2.12.1)
|
30
30
|
multi_json (~> 1.3)
|
31
|
-
json (1.
|
31
|
+
json (1.8.0)
|
32
32
|
method_source (0.8.2)
|
33
33
|
mime-types (1.25)
|
34
34
|
mini_portile (0.5.1)
|
@@ -69,7 +69,7 @@ PLATFORMS
|
|
69
69
|
ruby
|
70
70
|
|
71
71
|
DEPENDENCIES
|
72
|
-
bundler
|
72
|
+
bundler
|
73
73
|
cucumber
|
74
74
|
json
|
75
75
|
pry
|
@@ -24,7 +24,7 @@ end
|
|
24
24
|
|
25
25
|
Then /^swamp should not output any snippet$/ do
|
26
26
|
prompt_message = "Enter the url for the page to be scanned:"
|
27
|
-
output.
|
27
|
+
output.should have_at_least(1).messages
|
28
28
|
output.messages.should include(prompt_message)
|
29
29
|
end
|
30
30
|
|
@@ -41,6 +41,6 @@ When /^I attempt to hit enter at the terminal$/ do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
Then /^swamp should scan the current page$/ do
|
44
|
-
output.
|
44
|
+
output.should have_at_least(3).messages
|
45
45
|
output.messages.last.should == "def sign_up\n source.click_button(\"Sign Up\")\nend"
|
46
46
|
end
|
data/lib/swamp/interface.rb
CHANGED
@@ -14,6 +14,7 @@ module Swamp
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def scan(input)
|
17
|
+
@output.puts "Scanning, please wait..."
|
17
18
|
evaluator = Swamp::Evaluator.new(input, @wrapper)
|
18
19
|
messages = (evaluator.valid_url? or evaluator.refresh_command?) ? request(input) : INVALID_REQUEST_MESSAGE
|
19
20
|
present messages
|
@@ -24,6 +25,8 @@ module Swamp
|
|
24
25
|
@wrapper.scan
|
25
26
|
end
|
26
27
|
|
28
|
+
private
|
29
|
+
|
27
30
|
def present(messages)
|
28
31
|
messages.each do |message|
|
29
32
|
@output.puts(message)
|
data/lib/swamp/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Swamp
|
2
|
-
VERSION = '0.0.
|
3
|
-
end
|
2
|
+
VERSION = '0.0.5'
|
3
|
+
end
|
data/lib/swamp.rb
CHANGED
@@ -13,6 +13,11 @@ module Swamp
|
|
13
13
|
end
|
14
14
|
|
15
15
|
describe "#scan" do
|
16
|
+
it "warns the user that it is scanning" do
|
17
|
+
output.should_receive(:puts).with("Scanning, please wait...")
|
18
|
+
interface.scan("http://www.fakepage.com")
|
19
|
+
end
|
20
|
+
|
16
21
|
it "delegates the responsibility to fire up the browser to the wrapper class" do
|
17
22
|
wrapper.should_receive(:explore)
|
18
23
|
interface.scan("http://www.fakepage.com")
|
data/swamp.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "capybara"
|
22
22
|
spec.add_dependency "selenium-webdriver"
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "bundler"
|
25
25
|
spec.add_development_dependency "rake"
|
26
26
|
spec.add_development_dependency "rspec"
|
27
27
|
spec.add_development_dependency "cucumber"
|
data/tags
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
|
2
|
+
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
|
3
|
+
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
|
4
|
+
!_TAG_PROGRAM_NAME Exuberant Ctags //
|
5
|
+
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
|
6
|
+
!_TAG_PROGRAM_VERSION 5.8 //
|
7
|
+
Base lib/swamp/base.rb /^ class Base$/;" c class:Swamp
|
8
|
+
Builder lib/swamp/builder.rb /^ class Builder$/;" c class:Swamp
|
9
|
+
Button lib/swamp/button.rb /^ class Button < Element$/;" c class:Swamp
|
10
|
+
Buttons lib/swamp/buttons.rb /^ class Buttons < Elements$/;" c class:Swamp
|
11
|
+
Element lib/swamp/element.rb /^ class Element$/;" c class:Swamp
|
12
|
+
Elements lib/swamp/elements.rb /^ class Elements < Base$/;" c class:Swamp
|
13
|
+
Evaluator lib/swamp/evaluator.rb /^ class Evaluator$/;" c class:Swamp
|
14
|
+
Field lib/swamp/field.rb /^ class Field < Element$/;" c class:Swamp
|
15
|
+
Fields lib/swamp/fields.rb /^ class Fields < Elements$/;" c class:Swamp
|
16
|
+
Formatter lib/swamp/formatter.rb /^ class Formatter$/;" c class:Swamp
|
17
|
+
InputButton lib/swamp/input_button.rb /^ class InputButton < Element$/;" c class:Swamp
|
18
|
+
InputButtons lib/swamp/input_buttons.rb /^ class InputButtons < Elements$/;" c class:Swamp
|
19
|
+
Interface lib/swamp/interface.rb /^ class Interface$/;" c class:Swamp
|
20
|
+
Link lib/swamp/link.rb /^ class Link < Element$/;" c class:Swamp
|
21
|
+
Links lib/swamp/links.rb /^ class Links < Elements$/;" c class:Swamp
|
22
|
+
Output features/support/setup.rb /^class Output$/;" c
|
23
|
+
SelectBox lib/swamp/select_box.rb /^ class SelectBox < Element$/;" c class:Swamp
|
24
|
+
SelectBoxes lib/swamp/select_boxes.rb /^ class SelectBoxes < Elements$/;" c class:Swamp
|
25
|
+
Swamp lib/swamp.rb /^module Swamp$/;" m
|
26
|
+
Swamp lib/swamp/base.rb /^module Swamp$/;" m
|
27
|
+
Swamp lib/swamp/builder.rb /^module Swamp$/;" m
|
28
|
+
Swamp lib/swamp/button.rb /^module Swamp$/;" m
|
29
|
+
Swamp lib/swamp/buttons.rb /^module Swamp$/;" m
|
30
|
+
Swamp lib/swamp/element.rb /^module Swamp$/;" m
|
31
|
+
Swamp lib/swamp/elements.rb /^module Swamp$/;" m
|
32
|
+
Swamp lib/swamp/evaluator.rb /^module Swamp$/;" m
|
33
|
+
Swamp lib/swamp/field.rb /^module Swamp$/;" m
|
34
|
+
Swamp lib/swamp/fields.rb /^module Swamp$/;" m
|
35
|
+
Swamp lib/swamp/formatter.rb /^module Swamp$/;" m
|
36
|
+
Swamp lib/swamp/input_button.rb /^module Swamp$/;" m
|
37
|
+
Swamp lib/swamp/input_buttons.rb /^module Swamp$/;" m
|
38
|
+
Swamp lib/swamp/interface.rb /^module Swamp$/;" m
|
39
|
+
Swamp lib/swamp/link.rb /^module Swamp$/;" m
|
40
|
+
Swamp lib/swamp/links.rb /^module Swamp$/;" m
|
41
|
+
Swamp lib/swamp/select_box.rb /^module Swamp$/;" m
|
42
|
+
Swamp lib/swamp/select_boxes.rb /^module Swamp$/;" m
|
43
|
+
Swamp lib/swamp/version.rb /^module Swamp$/;" m
|
44
|
+
Swamp lib/swamp/wrapper.rb /^module Swamp$/;" m
|
45
|
+
Swamp spec/swamp/builder_spec.rb /^module Swamp$/;" m
|
46
|
+
Swamp spec/swamp/buttons_spec.rb /^module Swamp$/;" m
|
47
|
+
Swamp spec/swamp/evaluator_spec.rb /^module Swamp$/;" m
|
48
|
+
Swamp spec/swamp/fields_spec.rb /^module Swamp$/;" m
|
49
|
+
Swamp spec/swamp/formatter_spec.rb /^module Swamp$/;" m
|
50
|
+
Swamp spec/swamp/input_buttons_spec.rb /^module Swamp$/;" m
|
51
|
+
Swamp spec/swamp/interface_spec.rb /^module Swamp$/;" m
|
52
|
+
Swamp spec/swamp/links_spec.rb /^module Swamp$/;" m
|
53
|
+
Swamp spec/swamp/select_boxes_spec.rb /^module Swamp$/;" m
|
54
|
+
Swamp spec/swamp/wrapper_spec.rb /^module Swamp$/;" m
|
55
|
+
Wrapper lib/swamp/wrapper.rb /^ class Wrapper < Base$/;" c class:Swamp
|
56
|
+
accessor lib/swamp/button.rb /^ def accessor$/;" f class:Swamp.Button
|
57
|
+
accessor lib/swamp/element.rb /^ def accessor$/;" f class:Swamp.Element
|
58
|
+
accessor lib/swamp/field.rb /^ def accessor$/;" f class:Swamp.Field
|
59
|
+
accessor lib/swamp/input_button.rb /^ def accessor$/;" f class:Swamp.InputButton
|
60
|
+
accessor lib/swamp/link.rb /^ def accessor$/;" f class:Swamp.Link
|
61
|
+
accessor lib/swamp/select_box.rb /^ def accessor$/;" f class:Swamp.SelectBox
|
62
|
+
build_snippet lib/swamp/builder.rb /^ def build_snippet$/;" f class:Swamp.Builder
|
63
|
+
buttons features/support/setup.rb /^def buttons$/;" f
|
64
|
+
downcase_name lib/swamp/formatter.rb /^ def downcase_name$/;" f class:Swamp.Formatter
|
65
|
+
enter_keystroke? lib/swamp/evaluator.rb /^ def enter_keystroke?$/;" f class:Swamp.Evaluator
|
66
|
+
explore lib/swamp/wrapper.rb /^ def explore(url)$/;" f class:Swamp.Wrapper
|
67
|
+
fields features/support/setup.rb /^def fields$/;" f
|
68
|
+
format lib/swamp/element.rb /^ def format(text)$/;" f class:Swamp.Element
|
69
|
+
format lib/swamp/formatter.rb /^ def format(name)$/;" f class:Swamp.Formatter
|
70
|
+
format_class lib/swamp/formatter.rb /^ def format_class(name)$/;" f class:Swamp.Formatter
|
71
|
+
formatter lib/swamp/elements.rb /^ def formatter$/;" f class:Swamp.Elements
|
72
|
+
get lib/swamp/buttons.rb /^ def get$/;" f class:Swamp.Buttons
|
73
|
+
get lib/swamp/fields.rb /^ def get$/;" f class:Swamp.Fields
|
74
|
+
get lib/swamp/input_buttons.rb /^ def get$/;" f class:Swamp.InputButtons
|
75
|
+
get lib/swamp/links.rb /^ def get$/;" f class:Swamp.Links
|
76
|
+
get lib/swamp/select_boxes.rb /^ def get$/;" f class:Swamp.SelectBoxes
|
77
|
+
has_class? lib/swamp/elements.rb /^ def has_class?(element)$/;" f class:Swamp.Elements
|
78
|
+
has_id? lib/swamp/elements.rb /^ def has_id?(element)$/;" f class:Swamp.Elements
|
79
|
+
has_name? lib/swamp/elements.rb /^ def has_name?(element)$/;" f class:Swamp.Elements
|
80
|
+
has_no_punctuation? lib/swamp/elements.rb /^ def has_no_punctuation?(string)$/;" f class:Swamp.Elements
|
81
|
+
has_valid_id? lib/swamp/elements.rb /^ def has_valid_id?(element)$/;" f class:Swamp.Elements
|
82
|
+
has_valid_text? lib/swamp/elements.rb /^ def has_valid_text?(element)$/;" f class:Swamp.Elements
|
83
|
+
has_valid_value? lib/swamp/elements.rb /^ def has_valid_value?(element)$/;" f class:Swamp.Elements
|
84
|
+
has_value? lib/swamp/elements.rb /^ def has_value?(element)$/;" f class:Swamp.Elements
|
85
|
+
identation lib/swamp/builder.rb /^ def identation$/;" f class:Swamp.Builder
|
86
|
+
initialize lib/swamp/base.rb /^ def initialize$/;" f class:Swamp.Base
|
87
|
+
initialize lib/swamp/builder.rb /^ def initialize(element)$/;" f class:Swamp.Builder
|
88
|
+
initialize lib/swamp/element.rb /^ def initialize(name, selector)$/;" f class:Swamp.Element
|
89
|
+
initialize lib/swamp/evaluator.rb /^ def initialize(input, wrapper)$/;" f class:Swamp.Evaluator
|
90
|
+
initialize lib/swamp/interface.rb /^ def initialize(output, wrapper)$/;" f class:Swamp.Interface
|
91
|
+
initialize lib/swamp/wrapper.rb /^ def initialize(meta_collection)$/;" f class:Swamp.Wrapper
|
92
|
+
input_buttons features/support/setup.rb /^def input_buttons$/;" f
|
93
|
+
line_break lib/swamp/builder.rb /^ def line_break$/;" f class:Swamp.Builder
|
94
|
+
links features/support/setup.rb /^def links$/;" f
|
95
|
+
messages features/support/setup.rb /^ def messages$/;" f class:Output
|
96
|
+
method_definition lib/swamp/builder.rb /^ def method_definition$/;" f class:Swamp.Builder
|
97
|
+
method_end lib/swamp/builder.rb /^ def method_end$/;" f class:Swamp.Builder
|
98
|
+
method_signature lib/swamp/button.rb /^ def method_signature$/;" f class:Swamp.Button
|
99
|
+
method_signature lib/swamp/element.rb /^ def method_signature$/;" f class:Swamp.Element
|
100
|
+
method_signature lib/swamp/field.rb /^ def method_signature$/;" f class:Swamp.Field
|
101
|
+
method_signature lib/swamp/input_button.rb /^ def method_signature$/;" f class:Swamp.InputButton
|
102
|
+
method_signature lib/swamp/link.rb /^ def method_signature$/;" f class:Swamp.Link
|
103
|
+
method_signature lib/swamp/select_box.rb /^ def method_signature$/;" f class:Swamp.SelectBox
|
104
|
+
output features/support/setup.rb /^def output$/;" f
|
105
|
+
prefix lib/swamp/builder.rb /^ def prefix$/;" f class:Swamp.Builder
|
106
|
+
present lib/swamp/interface.rb /^ def present(messages)$/;" f class:Swamp.Interface
|
107
|
+
puts features/support/setup.rb /^ def puts(message)$/;" f class:Output
|
108
|
+
refresh_command? lib/swamp/evaluator.rb /^ def refresh_command?$/;" f class:Swamp.Evaluator
|
109
|
+
remove_suffix_symbols lib/swamp/formatter.rb /^ def remove_suffix_symbols$/;" f class:Swamp.Formatter
|
110
|
+
remove_white_spaces lib/swamp/formatter.rb /^ def remove_white_spaces$/;" f class:Swamp.Formatter
|
111
|
+
replace_brackets lib/swamp/formatter.rb /^ def replace_brackets$/;" f class:Swamp.Formatter
|
112
|
+
replace_dashes lib/swamp/formatter.rb /^ def replace_dashes$/;" f class:Swamp.Formatter
|
113
|
+
replace_parentheses lib/swamp/formatter.rb /^ def replace_parentheses$/;" f class:Swamp.Formatter
|
114
|
+
replace_white_spaces_with_dots lib/swamp/formatter.rb /^ def replace_white_spaces_with_dots$/;" f class:Swamp.Formatter
|
115
|
+
request lib/swamp/interface.rb /^ def request(input)$/;" f class:Swamp.Interface
|
116
|
+
run lib/swamp/interface.rb /^ def run$/;" f class:Swamp.Interface
|
117
|
+
scan lib/swamp/interface.rb /^ def scan(input)$/;" f class:Swamp.Interface
|
118
|
+
scan lib/swamp/wrapper.rb /^ def scan$/;" f class:Swamp.Wrapper
|
119
|
+
select_boxes features/support/setup.rb /^def select_boxes$/;" f
|
120
|
+
setup_capybara lib/swamp/base.rb /^ def setup_capybara$/;" f class:Swamp.Base
|
121
|
+
swamp features/support/setup.rb /^def swamp$/;" f
|
122
|
+
valid_type? lib/swamp/fields.rb /^ def valid_type?(element)$/;" f class:Swamp.Fields
|
123
|
+
valid_url? lib/swamp/evaluator.rb /^ def valid_url?$/;" f class:Swamp.Evaluator
|
124
|
+
wrapper features/support/setup.rb /^def wrapper$/;" f
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swamp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juraci de Lima Vieira Neto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,6 +145,7 @@ executables:
|
|
145
145
|
extensions: []
|
146
146
|
extra_rdoc_files: []
|
147
147
|
files:
|
148
|
+
- .gitignore
|
148
149
|
- .rspec
|
149
150
|
- .travis.yml
|
150
151
|
- Gemfile
|
@@ -210,6 +211,7 @@ files:
|
|
210
211
|
- spec/swamp/select_boxes_spec.rb
|
211
212
|
- spec/swamp/wrapper_spec.rb
|
212
213
|
- swamp.gemspec
|
214
|
+
- tags
|
213
215
|
homepage: ''
|
214
216
|
licenses:
|
215
217
|
- MIT
|