cuba 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Michel Martens
1
+ Copyright (c) 2010 Michel Martens and Damian Janowski
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README.markdown CHANGED
@@ -8,9 +8,13 @@ Rum based microframework for web development.
8
8
  Description
9
9
  -----------
10
10
 
11
- Cuba is a light wrapper around [Rum](http://github.com/chneukirchen/rum), a tiny but powerful mapper for [Rack](http://github.com/chneukirchen/rack) applications.
11
+ Cuba is a light wrapper around [Rum](http://github.com/chneukirchen/rum),
12
+ a tiny but powerful mapper for [Rack](http://github.com/chneukirchen/rack)
13
+ applications.
12
14
 
13
- It integrates [Haml](http://haml-lang.com/) templates via [Tilt](http://github.com/rtomayko/tilt), and testing via [Contest](http://github.com/citrusbyte/contest) and [Stories](http://github.com/citrusbyte/stories).
15
+ It integrates many templates via [Tilt](http://github.com/rtomayko/tilt),
16
+ and testing via [Cutest](http://github.com/djanowski/cutest) and
17
+ [Capybara](http://github.com/jnicklas/capybara).
14
18
 
15
19
  Usage
16
20
  -----
@@ -20,6 +24,8 @@ Here's a simple application:
20
24
  # cat hello_world.rb
21
25
  require "cuba"
22
26
 
27
+ Cuba.use Rack::Session::Cookie
28
+
23
29
  Cuba.define do
24
30
  on get do
25
31
  on path("hello") do
@@ -35,13 +41,11 @@ Here's a simple application:
35
41
  # cat hello_world_test.rb
36
42
  require "cuba/test"
37
43
 
38
- Cuba.test "My App" do
39
- story "As a user I want to be greeted with a Hello world" do
40
- scenario "A user visits the homepage" do
41
- visit "/"
44
+ scope do
45
+ test "Homepage" do
46
+ visit "/"
42
47
 
43
- assert_contain "Hello world!"
44
- end
48
+ assert has_content?("Hello world!")
45
49
  end
46
50
  end
47
51
 
@@ -54,7 +58,10 @@ To run it, you can create a `config.ru`:
54
58
 
55
59
  That's it, you can now run `rackup` and enjoy what you have just created.
56
60
 
57
- For more information about what you can do, check [Rum's documentation](http://github.com/chneukirchen/rum). To see how you can test it, check the documentation for [Stories](http://github.com/citrusbyte/stories).
61
+ For more information about what you can do, check [Rum's
62
+ documentation](http://github.com/chneukirchen/rum). To see how you can test it,
63
+ check the documentation for [Cutest](http://github.com/djanowski/cutest) and
64
+ [Capybara](http://github.com/jnicklas/capybara).
58
65
 
59
66
  Installation
60
67
  ------------
@@ -64,7 +71,7 @@ Installation
64
71
  License
65
72
  -------
66
73
 
67
- Copyright (c) 2010 Michel Martens
74
+ Copyright (c) 2010 Michel Martens and Damian Janowski
68
75
 
69
76
  Permission is hereby granted, free of charge, to any person
70
77
  obtaining a copy of this software and associated documentation
data/cuba.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cuba"
3
- s.version = "0.1.0"
3
+ s.version = "0.2.0"
4
4
  s.summary = "Rum based microframework for web applications."
5
5
  s.description = "Cuba is a light wrapper for Rum, a microframework for Rack applications."
6
6
  s.authors = ["Michel Martens"]
data/lib/cuba.rb CHANGED
@@ -2,14 +2,19 @@ require "cuba/version"
2
2
  require "cuba/ron"
3
3
 
4
4
  module Cuba
5
+ def self.app
6
+ @app ||= Rack::Builder.new
7
+ end
8
+
9
+ def self.use(middleware)
10
+ app.use(middleware)
11
+ end
12
+
5
13
  def self.define(&block)
6
- @app = Rack::Builder.new do
7
- use Rack::Session::Cookie
8
- run Cuba::Ron.new(&block)
9
- end
14
+ app.run Cuba::Ron.new(&block)
10
15
  end
11
16
 
12
17
  def self.call(env)
13
- @app.call(env)
18
+ app.call(env)
14
19
  end
15
20
  end
data/lib/cuba/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cuba
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
7
+ - 2
8
8
  - 0
9
- version: 0.1.0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michel Martens
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-22 00:00:00 -03:00
17
+ date: 2010-09-25 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency