true-web 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
- if respond_to? :source
2
- source :gemcutter
3
- source "http://gems.github.com"
4
- end
1
+ source :gemcutter
5
2
 
6
3
  gemspec :name => "true-web"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- true-web (0.1.1)
4
+ true-web (0.1.2)
5
5
  activesupport (>= 3.0.0)
6
6
  honkster-addressable (>= 2.2.3)
7
7
  mustache
@@ -11,7 +11,6 @@ PATH
11
11
 
12
12
  GEM
13
13
  remote: http://rubygems.org/
14
- remote: http://gems.github.com/
15
14
  specs:
16
15
  activesupport (3.0.9)
17
16
  addressable (2.2.4)
@@ -1,3 +1,3 @@
1
1
  module TrueWeb
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -18,7 +18,7 @@ module TrueWeb
18
18
  {
19
19
  'data-template' => path,
20
20
  'data-type' => "Template"
21
- }.only(*metadata_keys)
21
+ }
22
22
  end
23
23
 
24
24
  def define_method_via_include(method_name, &definition)
@@ -26,10 +26,6 @@ module TrueWeb
26
26
  define_method(method_name, &definition)
27
27
  end)
28
28
  end
29
-
30
- def metadata_keys
31
- ['data-template', 'data-type']
32
- end
33
29
  end
34
30
 
35
31
  attr_reader :app_instance
@@ -23,4 +23,6 @@ FixtureApp.init(
23
23
  :root_dir => File.dirname(__FILE__),
24
24
  :named_routes => FixtureApp::Routes,
25
25
  :views_class => FixtureApp::Views
26
- )
26
+ )
27
+
28
+ FixtureApp.register_service("#{File.dirname(__FILE__)}/services/authentication")
@@ -0,0 +1,5 @@
1
+ mustache "/authentication/index.html.ms" do |param1|
2
+ {
3
+ "param1" => param1
4
+ }
5
+ end
@@ -1 +1,4 @@
1
- <div class="authentication-index"></div>
1
+ <div class="authentication-index">
2
+ <div class="child-div"></div>
3
+ {{param1}}
4
+ </div>
@@ -1 +1 @@
1
- self.url_prefix = "/authentication"
1
+ self.url_prefix = "/authentication"
@@ -13,7 +13,17 @@ module TrueWeb
13
13
  describe "lazily created method" do
14
14
  context "when the presenter file exists" do
15
15
  it "evals the presenter file (which is responsible for adding the method)" do
16
- pending "Testing"
16
+ authentication_path = "#{FixtureApp.root_dir}/services/authentication"
17
+ service = Service.new(authentication_path).init
18
+ app_instance = Object.new
19
+ stub(app_instance).services {[service]}
20
+ stub(app_instance).config {FixtureApp}
21
+ views = Class.new(TrueWeb::Views).new(app_instance)
22
+
23
+ html = views["/authentication/index.html.ms"].call("param1 value")
24
+ html.should include("param1 value")
25
+ doc = Nokogiri::HTML(html)
26
+ doc.at(".child-div").should be_present
17
27
  end
18
28
  end
19
29
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: true-web
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brian Takita
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-16 00:00:00 -07:00
13
+ date: 2011-07-17 00:00:00 -07:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -181,6 +181,7 @@ files:
181
181
  - lib/true-web/version.rb
182
182
  - lib/true-web/views.rb
183
183
  - spec/fixture-app/app.rb
184
+ - spec/fixture-app/services/authentication/app/presenters/index.html.ms.rb
184
185
  - spec/fixture-app/services/authentication/app/templates/index.html.ms
185
186
  - spec/fixture-app/services/authentication/init.rb
186
187
  - spec/fixture-app/services/authentication/public/javascripts/foo.js