adyen-skinbuilder 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +31 -0
  4. data/Guardfile +5 -0
  5. data/README.markdown +26 -0
  6. data/Rakefile +7 -0
  7. data/TODO.markdown +16 -0
  8. data/adyen-skinbuilder.gemspec +24 -0
  9. data/adyen/main_content.html +1 -0
  10. data/adyen/skeleton.html +60 -0
  11. data/bin/adyen-skinbuilder +6 -0
  12. data/lib/adyen-skinbuilder.rb +8 -0
  13. data/lib/adyen-skinbuilder/launcher.rb +40 -0
  14. data/lib/adyen-skinbuilder/railtie.rb +9 -0
  15. data/lib/adyen-skinbuilder/server.rb +65 -0
  16. data/lib/adyen-skinbuilder/tasks/skin.rake +13 -0
  17. data/lib/adyen-skinbuilder/version.rb +5 -0
  18. data/spec/fixtures/skins/DV3tf95f/css/screen.css +262 -0
  19. data/spec/fixtures/skins/base/css/print.css +7 -0
  20. data/spec/fixtures/skins/base/css/screen_ie6.css +1 -0
  21. data/spec/fixtures/skins/base/img/Airliner.airjamaica.a340.arp.750pix.jpg +0 -0
  22. data/spec/fixtures/skins/base/img/Eurofighter.jpg +0 -0
  23. data/spec/fixtures/skins/base/img/bg_gr.jpg +0 -0
  24. data/spec/fixtures/skins/base/img/blog_gr.jpg +0 -0
  25. data/spec/fixtures/skins/base/img/category.gif +0 -0
  26. data/spec/fixtures/skins/base/img/mig.jpg +0 -0
  27. data/spec/fixtures/skins/base/img/top1.jpg +0 -0
  28. data/spec/fixtures/skins/base/img/top2.jpg +0 -0
  29. data/spec/fixtures/skins/base/img/top3.jpg +0 -0
  30. data/spec/fixtures/skins/base/inc/cfooter.txt +15 -0
  31. data/spec/fixtures/skins/base/inc/cheader.txt +11 -0
  32. data/spec/fixtures/skins/base/inc/pmfooter.txt +1 -0
  33. data/spec/fixtures/skins/base/inc/pmheader.txt +4 -0
  34. data/spec/fixtures/skins/base/res/resources.properties +0 -0
  35. data/spec/lib/adyen-skinbuilder/server_spec.rb +73 -0
  36. data/spec/spec_helper.rb +6 -0
  37. metadata +179 -0
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ pkg/*
3
+ *.gem
4
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,31 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ adyen-skinbuilder (0.0.1)
5
+ rack (>= 1.2)
6
+ slop (>= 1.6.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.1.2)
12
+ rack (1.2.2)
13
+ rack-test (0.5.7)
14
+ rack (>= 1.0)
15
+ rspec (2.5.0)
16
+ rspec-core (~> 2.5.0)
17
+ rspec-expectations (~> 2.5.0)
18
+ rspec-mocks (~> 2.5.0)
19
+ rspec-core (2.5.1)
20
+ rspec-expectations (2.5.0)
21
+ diff-lcs (~> 1.1.2)
22
+ rspec-mocks (2.5.0)
23
+ slop (1.6.0)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ adyen-skinbuilder!
30
+ rack-test
31
+ rspec
data/Guardfile ADDED
@@ -0,0 +1,5 @@
1
+ guard 'rspec', :version => 2, :cli => "--color", :bundler => true, :all_on_start => false, :all_after_pass => false, :keep_failed => true, :notification => false do
2
+ watch('spec/spec_helper.rb') { "spec" }
3
+ watch(%r{^spec/.+_spec\.rb})
4
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
5
+ end
data/README.markdown ADDED
@@ -0,0 +1,26 @@
1
+ Simple Rack server to make Adyen skin authoring easier. Also includes rake tasks to bundle skin directories into deployable bundles (not yet implemented):
2
+
3
+ ## Install
4
+
5
+ sudo gem install adyen-skinbuilder
6
+
7
+ ## Usage
8
+
9
+ Make sure you have directory with basic Adyen skin structure, that looks something like this:
10
+
11
+ +- ~/Documents
12
+ +- DV3tf95f
13
+ +- css
14
+ +- img
15
+ +- inc
16
+ +- cfooter.txt
17
+ +- cheader.txt
18
+ +- js
19
+
20
+ To view something that is very much similar to the end result generated in Adyen, fire up adyen-skinbuilder rack server, that does the template rendering on your local machine:
21
+
22
+ adyen-skinbuilder ~/Documents/DV3tf95f
23
+
24
+ And go to http://localhost:8888 to see the generated page.
25
+
26
+ See `adyen-skinbuilder --help` for options when running this server.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ desc 'Generate TODO.markdown using DNote'
5
+ task :todolist do
6
+ `dnote --format md --output TODO.markdown --title "TODO list"`
7
+ end
data/TODO.markdown ADDED
@@ -0,0 +1,16 @@
1
+ TODO list
2
+ =========
3
+
4
+ TODO
5
+ ----
6
+
7
+ ### file://lib/adyen-skinbuilder.rb
8
+
9
+ * TODO: skin bundle generator (7)
10
+ * TODO: Init task to build adyen skins directory structure (8)
11
+
12
+ ### file://lib/adyen-skinbuilder/server.rb
13
+
14
+ * TODO: add locale support so files like inc/cheader_[locale].txt will be included correctly (25)
15
+ * TODO: process Adyen default files at "/hpp" (51)
16
+
@@ -0,0 +1,24 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+ require 'adyen-skinbuilder/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'adyen-skinbuilder'
6
+ s.version = Adyen::Skinbuilder::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ['Priit Haamer']
9
+ s.email = ['priit@edicy.com']
10
+ s.homepage = 'http://rubygems.org/gems/adyen-skinbuilder'
11
+ s.summary = %q{Simple Rack server to make coding Adyen skins easier}
12
+ s.description = %q{Provides helpful rake tasks and command line tools to run rack server and bundle adyen skin files}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ['lib']
18
+
19
+ s.add_dependency 'rack', '>= 1.2'
20
+ s.add_dependency 'slop', '>= 1.6.0'
21
+
22
+ s.add_development_dependency 'rspec'
23
+ s.add_development_dependency 'rack-test'
24
+ end
@@ -0,0 +1 @@
1
+ == adyen main content ==
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Page Title</title>
7
+
8
+ <link rel="stylesheet" media="screen" type="text/css" href="/hpp/css/reset.css" />
9
+ <link rel="stylesheet" media="screen" type="text/css" href="/sf/$skinCode/css/screen.css" />
10
+ <link rel="stylesheet" media="print" type="text/css" href="/sf/$skinCode/css/print.css" />
11
+ <script type="text/javascript" src="/hpp/js/default.js"></script>
12
+
13
+ <script type="text/javascript" src="/sf/$skinCode/js/custom.js"></script>
14
+ <!--[if lt IE 7]>
15
+ <link rel="stylesheet" type="text/css" href="/sf/$skinCode/css/screen_ie6.css" />
16
+ <![endif]-->
17
+ </head>
18
+ <body>
19
+ <!-- ### inc/cheader_[locale].txt or inc/cheader.txt (fallback) ### -->
20
+ <form id="pageform" action="" method="post" onsubmit="return formValidate(this);">
21
+ <script type="text/javascript">
22
+ //<![CDATA[
23
+ if (notNull(document.getElementById('pageform'))) {
24
+ document.getElementById('pageform').setAttribute("autocomplete","off");
25
+ }
26
+ //]]>
27
+ </script>
28
+ <div id="content">
29
+
30
+ <div id="pmcontent">
31
+ <!-- ### inc/pmheader_[locale].txt or inc/pmheader.txt (fallback) ### -->
32
+ <div class="padDiv1"></div>
33
+
34
+ <!-- ==================== -->
35
+ <!-- Adyen Main Content -->
36
+ <!-- ==================== -->
37
+
38
+ <div class="padDiv2"></div>
39
+ <!-- ### inc/pmfooter_[locale].txt or inc/pmfooter.txt (fallback) ### -->
40
+ <!-- ### inc/customfields_[locale].txt or inc/customfields.txt (fallback) ### -->
41
+
42
+ </div>
43
+ </div>
44
+ <div id="foot">
45
+ <div id="footc">
46
+ <div id="nextstep">
47
+ <div id="nextstepc">Next Step Text</div>
48
+ </div>
49
+ <div id="footerb1div">
50
+ <input onclick="" type="submit" id="mainSubmit" value="continue" class="footerB nextB" />
51
+ </div>
52
+ <div id="footerb2div">
53
+ <input onclick="" type="button" id="mainBack" value="previous" class="footerB backB" />
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </form>
58
+ <!-- ### inc/cfooter_[locale].txt or inc/cfooter.txt (fallback) ### -->
59
+ </body>
60
+ </html>
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'adyen-skinbuilder'
5
+
6
+ Adyen::SkinBuilder::Launcher.ignition
@@ -0,0 +1,8 @@
1
+ require 'adyen-skinbuilder/server'
2
+ require 'adyen-skinbuilder/version'
3
+ require 'adyen-skinbuilder/launcher'
4
+
5
+ require 'adyen-skinbuilder/railtie' if defined?(::Rails) && ::Rails::VERSION::MAJOR >= 3
6
+
7
+ # TODO: skin bundle generator
8
+ # TODO: Init task to build adyen skins directory structure
@@ -0,0 +1,40 @@
1
+ require 'slop'
2
+
3
+ module Adyen
4
+ module SkinBuilder
5
+ class Launcher
6
+
7
+ def self.ignition(*argv)
8
+ opts = Slop.parse do
9
+ banner "\nUsage: adyen-skinbuilder [options] path\n"
10
+
11
+ on :P, :port, 'Port, defaults to 8888', true, :default => 8888
12
+ on :l, :log, 'Show server log'
13
+ on :V, :version, 'Print the version' do
14
+ puts "Adyen Skinbuilder version #{Adyen::Skinbuilder::VERSION}"
15
+ exit
16
+ end
17
+ on :h, :help, 'Print this help message' do
18
+ puts help
19
+ exit
20
+ end
21
+ end
22
+
23
+ # If skins directory is not provided or does not exist
24
+ if opts.parse.empty? or not File.exists?(File.expand_path(opts.parse.last))
25
+ puts opts.help
26
+ exit
27
+ end
28
+
29
+ puts "Using skin directory #{File.expand_path(opts.parse.last)}"
30
+ puts "Running server at http://localhost:#{opts[:port]}/"
31
+
32
+ Adyen::SkinBuilder::Server.run({
33
+ :port => opts[:port],
34
+ :log => opts[:log],
35
+ :skins_directory => File.expand_path(opts.parse.last)
36
+ })
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,9 @@
1
+ module Adyen
2
+ module SkinBuilder
3
+ class Railtie < ::Rails::Railtie
4
+ rake_tasks do
5
+ load 'adyen-skinbuilder/tasks/skin.rake'
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,65 @@
1
+ require 'rack'
2
+
3
+ module Adyen
4
+ module SkinBuilder
5
+ class SkeletonAdapter
6
+
7
+ def initialize(skins_directory)
8
+ @skins_directory = File.dirname(skins_directory)
9
+ @skin = File.basename(skins_directory)
10
+ end
11
+
12
+ def call(env)
13
+ body = File.read(File.join(File.dirname(__FILE__), '../../adyen/skeleton.html'))
14
+ body = body.gsub(/\$skinCode/, @skin)
15
+ %w(cheader pmheader pmfooter customfields cfooter).each do |inc|
16
+ body = body.gsub(%r{\<!-- ### inc\/#{inc}_\[locale\].txt or inc\/#{inc}.txt \(fallback\) ### --\>}, get_inc(inc))
17
+ end
18
+ body = body.gsub(%r{\<!-- Adyen Main Content --\>}, File.read(File.join(File.dirname(__FILE__), '../../adyen/main_content.html')))
19
+
20
+ [200, {'Content-Type' => 'text/html'}, [body]]
21
+ end
22
+
23
+ private
24
+
25
+ # TODO: add locale support so files like inc/cheader_[locale].txt will be included correctly
26
+ def get_inc(filename)
27
+ if File.exists?(File.join(@skins_directory, @skin, 'inc', "#{filename}.txt"))
28
+ File.read(File.join(@skins_directory, @skin, 'inc', "#{filename}.txt"))
29
+ elsif File.exists?(File.join(@skins_directory, 'base', 'inc', "#{filename}.txt"))
30
+ File.read(File.join(@skins_directory, 'base', 'inc', "#{filename}.txt"))
31
+ else
32
+ "<!-- == #{filename}.txt IS MISSING == -->"
33
+ end
34
+ end
35
+ end
36
+
37
+ class Server
38
+
39
+ class << self
40
+
41
+ def run(config)
42
+ handler = Rack::Handler.default
43
+ handler.run(self.app(config), :Port => config[:port], :AccessLog => [])
44
+ end
45
+
46
+ def app(config = {})
47
+ Rack::Builder.app do
48
+ use Rack::CommonLogger if config[:log]
49
+ use Rack::Head
50
+
51
+ # TODO: process Adyen default files at "/hpp"
52
+ map("/sf/#{File.basename(config[:skins_directory])}") do
53
+ run Rack::Cascade.new([
54
+ Rack::File.new(config[:skins_directory]),
55
+ Rack::File.new(File.join(File.dirname(config[:skins_directory]), 'base'))
56
+ ])
57
+ end
58
+
59
+ map('/') { run Adyen::SkinBuilder::SkeletonAdapter.new(config[:skins_directory]) }
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,13 @@
1
+ require 'adyen-skinbuilder'
2
+
3
+ namespace :adyen do
4
+ namespace :skin do
5
+
6
+ desc 'Run server to test Adyen skins'
7
+ task :server do
8
+ puts "Starting server at http://localhost:8888/"
9
+
10
+ Adyen::SkinBuilder::Server.run(:skin => 'lE00qtob')
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ module Adyen
2
+ module Skinbuilder
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,262 @@
1
+ html, body {
2
+ height: 100%;
3
+ margin: 0;
4
+ padding: 0;
5
+ font: 15px/19px verdana, serif;
6
+ color: #FFF;
7
+ background: #6A96BB url(../img/bg_gr.jpg) repeat-x top;
8
+ }
9
+
10
+ #content2 h1, #content2 h2, #content2 h3, #content2 h4, #content2 h5 {
11
+ /* Headers inside the actual content2sbox */
12
+ margin: 1em 17px 0.5em 10px;
13
+ text-align: right;
14
+ font-size: 1.4em;
15
+ }
16
+
17
+ h1, h2, h3, h4 {font-family: "georgia", serif; font-weight: bold;}
18
+
19
+ h3 { font-size: 1.2em;}
20
+ h3 a, h3 a:visited { text-decoration: none; color: #fff;}
21
+ h3 a:active { color: #f00;}
22
+ h3 a:hover { color: #fff000;}
23
+
24
+ #center {
25
+ /* Makes the page in center of the viewport */
26
+ position: relative;
27
+ width: 792px;
28
+ height: 100%;
29
+ margin: 0 auto;
30
+ background: transparent url(../img/blog_gr.jpg) repeat-y top right;
31
+ }
32
+
33
+ #pageform{
34
+ height: 20px;
35
+
36
+ }
37
+
38
+ #archives {
39
+ position: relative;
40
+ left: -20px;
41
+ padding: 0;
42
+ top: 228px;
43
+ width: 271px;
44
+ }
45
+
46
+ #archives h3 {
47
+ /* the clouds graphic is a background of every h3 inside #achives */
48
+ background: transparent url(../img/category.gif) no-repeat top right;
49
+ padding: 0 15px;
50
+ margin: 0;
51
+ vertical-align: middle;
52
+ line-height: 30px;
53
+ height: 38px;
54
+ text-align: right;
55
+
56
+ }
57
+
58
+ /* the archives list is a real list, but I don't dots or numbers, and that I change with the following: */
59
+
60
+ #archives ul {
61
+ margin: 0 22px 0 0;
62
+ padding: 0 0 10px 0;
63
+ }
64
+
65
+ #archives ul li {
66
+ list-style-type: none;
67
+ text-align: right;
68
+ margin: 5px 0;
69
+ }
70
+
71
+ #archives ul li a {
72
+ text-decoration: none;
73
+ color: #2F3B55;
74
+ font-family: "georgia", "palatino linotype", "times new roman", serif;
75
+ }
76
+
77
+ #archives ul li a:hover {color: #fff; text-decoration: underline;}
78
+
79
+
80
+ #content2 {
81
+ /* the actual content2 of the page */
82
+ position: absolute;
83
+ top: 198px;
84
+ width: 502px;
85
+ right: 0;
86
+ padding-right: 10px;
87
+ padding-left: 28px;
88
+ background: transparent url(../img/blog_gr.jpg) repeat-y top right;
89
+ }
90
+
91
+
92
+ #foot {
93
+ /* height: 60px;
94
+ background-color: white;
95
+ */
96
+ }
97
+
98
+ #content2 p {
99
+ margin: 15px 17px 15px 0px;
100
+ text-align: justify;
101
+ }
102
+
103
+ #content2 h2 {
104
+ color: #C8E5FF;
105
+ border-top: 1px dotted;
106
+ padding-top: 12px;
107
+ margin-left: 0px;
108
+ }
109
+
110
+
111
+ #home {
112
+ /* the box in the upper-left corner */
113
+ position: absolute;
114
+ top: 15px;
115
+ left: 80px;
116
+ width: 200px;
117
+ text-align: center;
118
+ z-index: 1;
119
+ }
120
+
121
+ #home * {
122
+ margin: 0;
123
+ padding: 3px 0;
124
+ }
125
+
126
+ #top1, #top2, #top3 {
127
+ display: block;
128
+ position: absolute;
129
+ top: 0;
130
+ background-repeat: no-repeat;
131
+ background-color: transparent;
132
+ }
133
+
134
+ /* the top-graphic is made with these three elements: */
135
+
136
+ #top1 {
137
+ right: 503px;
138
+ width: 55px;
139
+ height: 223px;
140
+ background-image: url(../img/top1.jpg);
141
+ }
142
+
143
+ #top2 {
144
+ right: 5px;
145
+ width: 498px;
146
+ height: 223px;
147
+ background-image: url(../img/top2.jpg);
148
+ }
149
+
150
+ #top3 {
151
+ right: -25px;
152
+ width: 30px;
153
+ height: 231px;
154
+ background-image: url(../img/top3.jpg);
155
+ }
156
+
157
+ pre {font-family: courier, monospace; font-size: 1em; color: black; }
158
+ table.basetable { margin-left: 5px;}
159
+ table.basetable td { padding-bottom: 0.6em; padding-right: 0.6em;}
160
+ table.od { margin: 10px 0px 10px 40px;}
161
+ table.od td { padding: 5px; border: 1px solid #999;}
162
+ table.od th { padding: 5px; font-weight: bold; border: 1px solid #999;}
163
+ .r { text-align: right; }
164
+ .l { text-align: left; }
165
+ .fr { float: right; }
166
+ .fl { float: left; }
167
+ .b {font-size:1em; font-weight:bold;}
168
+
169
+ .imgB {
170
+ width: 138px;
171
+ height: 32px;
172
+ padding: 0;
173
+ border: 0;
174
+ background: transparent url(../img/bg_buttons.png) no-repeat left 0px;
175
+ overflow: hidden;
176
+ color: white;
177
+ cursor: pointer; /* hand-shaped cursor */
178
+ cursor: hand; /* for IE 5.x */
179
+ font-weight: bold;
180
+ font-size: 1.2em;
181
+ }
182
+ form>.imgB { /* For non-IE browsers*/
183
+ height: 0px;
184
+ }
185
+
186
+ #footerb1div {
187
+ float: right;
188
+ }
189
+ #footerb2div {
190
+ float: right;
191
+ }
192
+
193
+ .pmB {
194
+ width: 238px;
195
+ height: 42px;
196
+ padding-left: 85px;
197
+ text-align: left;
198
+ margin-bottom: 6px;
199
+ font-size: 1.1em;
200
+ }
201
+
202
+ .footerB {
203
+ border: 2px outset black;
204
+ background-color: #ccc;
205
+ margin: 6px 10px 0 0;
206
+ }
207
+ .footerB:active {
208
+ border: 2px inset black;
209
+ }
210
+
211
+ #nextstep {display: none;}
212
+
213
+ .red {color:#c00;}
214
+ .popupMsg { display: none; border: 1px solid #666; color: black; background-color: #eee; margin-bottom:5px; padding: 6px;}
215
+
216
+ input, select
217
+ {
218
+ font-size: 0.95em;
219
+ padding: 1px;
220
+ border: 1px solid #C3C3C3;
221
+ border-top-color: #7C7C7C;
222
+ border-bottom-color: #DDD;
223
+ background: white url(../img/input_bg.png) 0 0 repeat-x;
224
+ }
225
+
226
+ input[type=text]:focus, input[type=password]:focus, select:focus {
227
+ background-color: #E7F1F8 !important;
228
+ }
229
+
230
+ select {
231
+ font-weight: bold;
232
+ }
233
+
234
+
235
+ select {
236
+ font-size: 0.9em;
237
+ }
238
+
239
+ table.basetable .inputField {
240
+ padding: 1px 2px 2px 2px;
241
+ background-color: white;
242
+ }
243
+
244
+
245
+ table.basetable .errorField {
246
+ border: 2px solid #f33;
247
+ background-color: #fff3f3;
248
+ padding: 1px 1px 1px 1px;
249
+ }
250
+
251
+ .fieldDiv {
252
+ padding-right: 20px;
253
+ background: transparent;
254
+ }
255
+ .errorDiv {
256
+ background: transparent url(/hpp/img/icons/error.png) no-repeat right 3px;
257
+ padding-right: 20px;
258
+ }
259
+ .errorFrame {
260
+ background-color: #fff3f3;
261
+ }
262
+
@@ -0,0 +1,7 @@
1
+ html {background:#fff; font-size:10pt; font-family: arial, sans-serif;}
2
+ #content {position:relative; z-index:3; word-wrap:break-word;}
3
+ #head {display:none;}
4
+ #printhead {height:100px; background:#fff; font-size:24pt; color:#000; border-bottom:1px solid #000;}
5
+ #printfoot {height:50px; background:#fff; color:#000; text-align:right; font-size:12pt; border-top:1px solid #000; margin-top:20px;}
6
+ #foot {display:none;}
7
+
@@ -0,0 +1 @@
1
+ #topbar1 { background-position: left top }
@@ -0,0 +1,15 @@
1
+ </div>
2
+ <div id="archives">&nbsp;
3
+ <h3>Home</h3>
4
+ <h3>Book online</h3>
5
+ <h3>Flight Info</h3>
6
+ <h3>Service</h3>
7
+ <h3>Offers</h3>
8
+ <h3>Hotel</h3>
9
+ <h3>Car Rental</h3>
10
+
11
+ </div>
12
+ <div id="top1"></div>
13
+ <div id="top2"></div>
14
+ <div id="top3"></div>
15
+ </div>
@@ -0,0 +1,11 @@
1
+ <div id="center">
2
+ <div id="home"> <!-- the box in the upper-left corner -->
3
+
4
+ <h1>paxjet</h1>
5
+
6
+ <h4>low cost, sky high</h4>
7
+ <p><img src="/sf/DV3tf95f/img/Airliner.airjamaica.a340.arp.750pix.jpg" alt="" height='100' width='120'/></p>
8
+ <p></p>
9
+
10
+ </div>
11
+ <div id="content2">
File without changes
@@ -0,0 +1,73 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require 'rack/test'
3
+
4
+ describe 'SkinBuilder server' do
5
+
6
+ include Rack::Test::Methods
7
+
8
+ def app
9
+ Adyen::SkinBuilder::Server.app(
10
+ :skins_directory => File.expand_path(File.join(File.dirname(__FILE__), '../../fixtures/skins/DV3tf95f'))
11
+ )
12
+ end
13
+
14
+ describe 'get asset from skin directory' do
15
+ before(:each) do
16
+ get '/sf/DV3tf95f/css/screen.css'
17
+ end
18
+
19
+ it 'responds with 200 status' do
20
+ last_response.status.should == 200
21
+ end
22
+
23
+ it 'responds with "text/css" content type header for CSS file' do
24
+ last_response.headers.fetch('Content-Type').should == 'text/css'
25
+ end
26
+ end
27
+
28
+ describe 'get asset from skins base directory' do
29
+ before(:each) do
30
+ get '/sf/DV3tf95f/css/print.css'
31
+ end
32
+
33
+ it 'responds with 200 status' do
34
+ last_response.status.should == 200
35
+ end
36
+
37
+ it 'responds with "text/css" content type header for CSS file' do
38
+ last_response.headers.fetch('Content-Type').should == 'text/css'
39
+ end
40
+ end
41
+
42
+ describe 'GET /' do
43
+ before(:each) do
44
+ get '/'
45
+ end
46
+
47
+ it 'responds with 200 status' do
48
+ last_response.status.should == 200
49
+ end
50
+
51
+ it 'returns adyen skeleton in HTML format' do
52
+ last_response.headers.fetch('Content-Type').should == 'text/html'
53
+ end
54
+ end
55
+
56
+ describe 'HEAD /' do
57
+ before(:each) do
58
+ head '/'
59
+ end
60
+
61
+ it 'responds withr 200 status' do
62
+ last_response.status.should == 200
63
+ end
64
+
65
+ it 'returns content type header' do
66
+ last_response.headers.should == { 'Content-Type' => 'text/html' }
67
+ end
68
+
69
+ it 'returns empty body' do
70
+ last_response.body.should == ''
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.setup(:default, :test)
5
+
6
+ require 'adyen-skinbuilder'
metadata ADDED
@@ -0,0 +1,179 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: adyen-skinbuilder
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Priit Haamer
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-05-19 00:00:00 +03:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rack
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 11
30
+ segments:
31
+ - 1
32
+ - 2
33
+ version: "1.2"
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: slop
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 15
45
+ segments:
46
+ - 1
47
+ - 6
48
+ - 0
49
+ version: 1.6.0
50
+ type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: rspec
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
64
+ type: :development
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
67
+ name: rack-test
68
+ prerelease: false
69
+ requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
77
+ version: "0"
78
+ type: :development
79
+ version_requirements: *id004
80
+ description: Provides helpful rake tasks and command line tools to run rack server and bundle adyen skin files
81
+ email:
82
+ - priit@edicy.com
83
+ executables:
84
+ - adyen-skinbuilder
85
+ extensions: []
86
+
87
+ extra_rdoc_files: []
88
+
89
+ files:
90
+ - .gitignore
91
+ - Gemfile
92
+ - Gemfile.lock
93
+ - Guardfile
94
+ - README.markdown
95
+ - Rakefile
96
+ - TODO.markdown
97
+ - adyen-skinbuilder.gemspec
98
+ - adyen/main_content.html
99
+ - adyen/skeleton.html
100
+ - bin/adyen-skinbuilder
101
+ - lib/adyen-skinbuilder.rb
102
+ - lib/adyen-skinbuilder/launcher.rb
103
+ - lib/adyen-skinbuilder/railtie.rb
104
+ - lib/adyen-skinbuilder/server.rb
105
+ - lib/adyen-skinbuilder/tasks/skin.rake
106
+ - lib/adyen-skinbuilder/version.rb
107
+ - spec/fixtures/skins/DV3tf95f/css/screen.css
108
+ - spec/fixtures/skins/base/css/print.css
109
+ - spec/fixtures/skins/base/css/screen_ie6.css
110
+ - spec/fixtures/skins/base/img/Airliner.airjamaica.a340.arp.750pix.jpg
111
+ - spec/fixtures/skins/base/img/Eurofighter.jpg
112
+ - spec/fixtures/skins/base/img/bg_gr.jpg
113
+ - spec/fixtures/skins/base/img/blog_gr.jpg
114
+ - spec/fixtures/skins/base/img/category.gif
115
+ - spec/fixtures/skins/base/img/mig.jpg
116
+ - spec/fixtures/skins/base/img/top1.jpg
117
+ - spec/fixtures/skins/base/img/top2.jpg
118
+ - spec/fixtures/skins/base/img/top3.jpg
119
+ - spec/fixtures/skins/base/inc/cfooter.txt
120
+ - spec/fixtures/skins/base/inc/cheader.txt
121
+ - spec/fixtures/skins/base/inc/pmfooter.txt
122
+ - spec/fixtures/skins/base/inc/pmheader.txt
123
+ - spec/fixtures/skins/base/res/resources.properties
124
+ - spec/lib/adyen-skinbuilder/server_spec.rb
125
+ - spec/spec_helper.rb
126
+ has_rdoc: true
127
+ homepage: http://rubygems.org/gems/adyen-skinbuilder
128
+ licenses: []
129
+
130
+ post_install_message:
131
+ rdoc_options: []
132
+
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ hash: 3
141
+ segments:
142
+ - 0
143
+ version: "0"
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ hash: 3
150
+ segments:
151
+ - 0
152
+ version: "0"
153
+ requirements: []
154
+
155
+ rubyforge_project:
156
+ rubygems_version: 1.4.2
157
+ signing_key:
158
+ specification_version: 3
159
+ summary: Simple Rack server to make coding Adyen skins easier
160
+ test_files:
161
+ - spec/fixtures/skins/DV3tf95f/css/screen.css
162
+ - spec/fixtures/skins/base/css/print.css
163
+ - spec/fixtures/skins/base/css/screen_ie6.css
164
+ - spec/fixtures/skins/base/img/Airliner.airjamaica.a340.arp.750pix.jpg
165
+ - spec/fixtures/skins/base/img/Eurofighter.jpg
166
+ - spec/fixtures/skins/base/img/bg_gr.jpg
167
+ - spec/fixtures/skins/base/img/blog_gr.jpg
168
+ - spec/fixtures/skins/base/img/category.gif
169
+ - spec/fixtures/skins/base/img/mig.jpg
170
+ - spec/fixtures/skins/base/img/top1.jpg
171
+ - spec/fixtures/skins/base/img/top2.jpg
172
+ - spec/fixtures/skins/base/img/top3.jpg
173
+ - spec/fixtures/skins/base/inc/cfooter.txt
174
+ - spec/fixtures/skins/base/inc/cheader.txt
175
+ - spec/fixtures/skins/base/inc/pmfooter.txt
176
+ - spec/fixtures/skins/base/inc/pmheader.txt
177
+ - spec/fixtures/skins/base/res/resources.properties
178
+ - spec/lib/adyen-skinbuilder/server_spec.rb
179
+ - spec/spec_helper.rb