RubyApp 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1,55 +1 @@
1
- #!/usr/bin/env bash
2
-
3
- # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
- # development environment upon cd'ing into the directory
5
-
6
- # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
7
- environment_id="ruby-1.8.7-p352@RubyApp"
8
-
9
- #
10
- # Uncomment following line if you want options to be set only for given project.
11
- #
12
- # PROJECT_JRUBY_OPTS=( --1.9 )
13
-
14
- #
15
- # First we attempt to load the desired environment directly from the environment
16
- # file. This is very fast and efficient compared to running through the entire
17
- # CLI and selector. If you want feedback on which environment was used then
18
- # insert the word 'use' after --create as this triggers verbose mode.
19
- #
20
- if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
21
- && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
22
- then
23
- \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
24
-
25
- if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
26
- then
27
- . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
28
- fi
29
- else
30
- # If the environment file has not yet been created, use the RVM CLI to select.
31
- if ! rvm --create use "$environment_id"
32
- then
33
- echo "Failed to create RVM environment '${environment_id}'."
34
- exit 1
35
- fi
36
- fi
37
-
38
- #
39
- # If you use an RVM gemset file to install a list of gems (*.gems), you can have
40
- # it be automatically loaded. Uncomment the following and adjust the filename if
41
- # necessary.
42
- #
43
- # filename=".gems"
44
- # if [[ -s "$filename" ]]
45
- # then
46
- # rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
47
- # fi
48
-
49
- # If you use bundler, this might be useful to you:
50
- # if command -v bundle && [[ -s Gemfile ]]
51
- # then
52
- # bundle install
53
- # fi
54
-
55
-
1
+ rvm ruby-1.8.7-p352@RubyApp
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RubyApp (0.0.23)
4
+ RubyApp (0.0.24)
5
5
  BlueCloth
6
6
  chronic
7
7
  chronic_duration
@@ -0,0 +1,8 @@
1
+ Feature: Quit page
2
+
3
+ Scenario: View the quit page
4
+ Given I go to the test pages
5
+ When I click "Settings"
6
+ Then I should see "Quit the session"
7
+ When I am viewing "/quit"
8
+ Then I should see "Click here to go to the test pages"
@@ -65,6 +65,14 @@ module RubyApp
65
65
  execute("RubyApp.updateElement('#{element.element_id}');")
66
66
  end
67
67
 
68
+ def add_class(selector, _class)
69
+ execute("RubyApp.add_class(#{selector.to_json}, #{_class.to_json});")
70
+ end
71
+
72
+ def remove_class(selector, _class)
73
+ execute("RubyApp.remove_class(#{selector.to_json}, #{_class.to_json});")
74
+ end
75
+
68
76
  def update_text(selector, value)
69
77
  execute("RubyApp.updateText(#{selector.to_json}, #{value.to_json});")
70
78
  end
@@ -75,6 +75,12 @@
75
75
  $('#'+id).replaceWith(content);
76
76
  } );
77
77
  },
78
+ this.addClass = function(selector, _class) {
79
+ $(selector).addClass(_class);
80
+ },
81
+ this.removeClass = function(selector, _class) {
82
+ $(selector).removeClass(_class);
83
+ },
78
84
  this.updateText = function(selector, value) {
79
85
  $(selector).text(value);
80
86
  },
@@ -1,5 +1,10 @@
1
- - self.content_for(:body) do
2
- /
3
- #{__FILE__}
4
- :javascript
5
- location.assign('/');
1
+ /
2
+ #{__FILE__}
3
+ !!! 5
4
+ %html{attributes}
5
+ %head
6
+ %title
7
+ = yield(:title) || self.translate.title
8
+ %body
9
+ :javascript
10
+ location.assign('/');
@@ -9,6 +9,7 @@ module RubyApp
9
9
  class QuitPage < RubyApp::Elements::Page
10
10
 
11
11
  template_path(:all, File.dirname(__FILE__))
12
+ exclude_parent_template(:all)
12
13
 
13
14
  def initialize
14
15
  super
@@ -14,7 +14,6 @@ module RubyApp
14
14
  require 'ruby_app/elements/pages/blank_page'
15
15
  require 'ruby_app/elements/pages/test_pages/button_test_page'
16
16
  require 'ruby_app/elements/pages/test_pages/dialog_test_page'
17
- require 'ruby_app/elements/pages/test_pages/exception_test_page'
18
17
  require 'ruby_app/elements/pages/test_pages/input_test_page'
19
18
  require 'ruby_app/elements/pages/test_pages/link_test_page'
20
19
  require 'ruby_app/elements/pages/test_pages/list_test_page'
@@ -9,7 +9,6 @@ module RubyApp
9
9
  module Rack
10
10
  require 'ruby_app/element'
11
11
  require 'ruby_app/elements/exception_element'
12
- require 'ruby_app/elements/pages/exception_page'
13
12
  require 'ruby_app/elements/pages/quit_page'
14
13
  require 'ruby_app/exceptions/session_invalid_exception'
15
14
  require 'ruby_app/log'
@@ -34,11 +33,7 @@ module RubyApp
34
33
  ]
35
34
  rescue Exception => exception
36
35
  RubyApp::Log.exception(exception)
37
- [
38
- 200,
39
- { 'content-type' => 'text/html' },
40
- [ RubyApp::Elements::Pages::ExceptionPage.new(exception).render(:html) ]
41
- ]
36
+ raise exception
42
37
  end
43
38
  end
44
39
 
@@ -70,11 +65,7 @@ module RubyApp
70
65
  ]
71
66
  rescue Exception => exception
72
67
  RubyApp::Log.exception(exception)
73
- [
74
- 200,
75
- { 'content-type' => RubyApp::Rack::Route.get_content_type(format) },
76
- [ RubyApp::Elements::Pages::ExceptionPage.new(exception).render(format.to_sym) ]
77
- ]
68
+ raise exception
78
69
  end
79
70
  end
80
71
 
@@ -67,7 +67,7 @@ module RubyApp
67
67
  end
68
68
 
69
69
  def quit
70
- RubyApp::Request.env['rack.session.options'][:drop] = true
70
+ RubyApp::Request.env['rack.session.options'][:drop] = true if RubyApp::Request.env['rack.session.options']
71
71
  end
72
72
 
73
73
  def self.get
@@ -7,9 +7,9 @@ module _APPLICATION_UPCODE_
7
7
 
8
8
  class Session < RubyApp::Session
9
9
 
10
- def initialize(page = nil)
10
+ def initialize(session_id, page = nil)
11
11
  require '_APPLICATION_DOWNCODE_/elements/pages/default_page'
12
- super(page || _APPLICATION_UPCODE_::Elements::Pages::DefaultPage.new)
12
+ super(session_id, page || _APPLICATION_UPCODE_::Elements::Pages::DefaultPage.new)
13
13
  end
14
14
 
15
15
  end
@@ -39,8 +39,6 @@ ruby_app:
39
39
 
40
40
  [`DialogTestPage`](RubyApp::Elements::Pages::TestPages::DialogTestPage) ... A page with links to show a variety of dialogs (e.g. busy dialog, exception dialog, message dialog, month dialog, etc.)
41
41
 
42
- [`ExceptionTestPage`](RubyApp::Elements::Pages::TestPages::ExceptionTestPage) ... A page that raises an exception when rendered
43
-
44
42
  [`InputTestPage`](RubyApp::Elements::Pages::TestPages::InputTestPage) ... A page with a variety of input controls (e.g. simple input, duration input, etc.)
45
43
 
46
44
  [`LinkTestPage`](RubyApp::Elements::Pages::TestPages::LinkTestPage) ... A page with a single, clickable link
@@ -181,6 +179,8 @@ ruby_app:
181
179
  title: myOpenID Authentication
182
180
  yahoo_authentication_page:
183
181
  title: Yahoo! Authentication
182
+ quit_page:
183
+ title: Quit
184
184
  settings_page:
185
185
  title: Settings
186
186
  content:
@@ -1,4 +1,4 @@
1
1
  module RubyApp
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
3
  ROOT = File.expand_path(File.dirname(__FILE__))
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RubyApp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 23
10
- version: 0.0.23
9
+ - 24
10
+ version: 0.0.24
11
11
  platform: ruby
12
12
  authors:
13
13
  - Frank G. Ficnar
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-11 00:00:00 Z
18
+ date: 2011-12-12 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -351,7 +351,7 @@ files:
351
351
  - features/elements/list.feature
352
352
  - features/elements/markdown.feature
353
353
  - features/elements/page.feature
354
- - features/elements/pages/exception_page.feature
354
+ - features/elements/pages/quit_page.feature
355
355
  - features/step_definitions/default_macros.rb
356
356
  - features/step_definitions/default_steps.rb
357
357
  - features/support/env.rb
@@ -451,8 +451,6 @@ files:
451
451
  - lib/ruby_app/elements/pages/default_page.html.haml
452
452
  - lib/ruby_app/elements/pages/default_page.js.haml
453
453
  - lib/ruby_app/elements/pages/default_page.rb
454
- - lib/ruby_app/elements/pages/exception_page.html.haml
455
- - lib/ruby_app/elements/pages/exception_page.rb
456
454
  - lib/ruby_app/elements/pages/quit_page.html.haml
457
455
  - lib/ruby_app/elements/pages/quit_page.rb
458
456
  - lib/ruby_app/elements/pages/settings_page.css.haml
@@ -471,8 +469,6 @@ files:
471
469
  - lib/ruby_app/elements/pages/test_pages/dialog_test_page.html.haml
472
470
  - lib/ruby_app/elements/pages/test_pages/dialog_test_page.js.haml
473
471
  - lib/ruby_app/elements/pages/test_pages/dialog_test_page.rb
474
- - lib/ruby_app/elements/pages/test_pages/exception_test_page.html.haml
475
- - lib/ruby_app/elements/pages/test_pages/exception_test_page.rb
476
472
  - lib/ruby_app/elements/pages/test_pages/input_test_page.css.haml
477
473
  - lib/ruby_app/elements/pages/test_pages/input_test_page.html.haml
478
474
  - lib/ruby_app/elements/pages/test_pages/input_test_page.js.haml
@@ -632,7 +628,7 @@ test_files:
632
628
  - features/elements/list.feature
633
629
  - features/elements/markdown.feature
634
630
  - features/elements/page.feature
635
- - features/elements/pages/exception_page.feature
631
+ - features/elements/pages/quit_page.feature
636
632
  - features/step_definitions/default_macros.rb
637
633
  - features/step_definitions/default_steps.rb
638
634
  - features/support/env.rb
@@ -1,10 +0,0 @@
1
- Feature: Exception page
2
-
3
- Scenario: View the exception page
4
- Given I go to the test pages
5
- When I click "ExceptionTestPage"
6
- Then I should see "RuntimeError"
7
- And I should see "Exception page"
8
- Given I am viewing "/quit"
9
- Then I should see "Click here to go to the test pages"
10
-
@@ -1,6 +0,0 @@
1
- - self.content_for(:title) do
2
- = @exception.class
3
- - self.content_for(:body) do
4
- /
5
- #{__FILE__}
6
- = @exception.message
@@ -1,23 +0,0 @@
1
- module RubyApp
2
-
3
- module Elements
4
-
5
- module Pages
6
- require 'ruby_app/elements/page'
7
-
8
- class ExceptionPage < RubyApp::Elements::Page
9
-
10
- template_path(:all, File.dirname(__FILE__))
11
-
12
- def initialize(exception)
13
- super()
14
- @exception = exception
15
- end
16
-
17
- end
18
-
19
- end
20
-
21
- end
22
-
23
- end
@@ -1,5 +0,0 @@
1
- - self.content_for(:content) do
2
- /
3
- #{__FILE__}
4
- = @markdown.render(:html) do |element|
5
- - element.content_for(:body, self.translate.content.body)
@@ -1,33 +0,0 @@
1
- module RubyApp
2
-
3
- module Elements
4
-
5
- module Pages
6
-
7
- module TestPages
8
- require 'ruby_app/elements/markdown'
9
- require 'ruby_app/elements/pages/blank_page'
10
-
11
- class ExceptionTestPage < RubyApp::Elements::Pages::BlankPage
12
-
13
- template_path(:all, File.dirname(__FILE__))
14
-
15
- def initialize
16
- super
17
- @markdown = RubyApp::Elements::Markdown.new
18
- end
19
-
20
- def render(format)
21
- raise self.translate.exception if format == :html
22
- super(format)
23
- end
24
-
25
- end
26
-
27
- end
28
-
29
- end
30
-
31
- end
32
-
33
- end