cuba-libre 0.0.1 → 0.0.2
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/README.md +3 -1
- data/Rakefile +6 -0
- data/bin/cuba +1 -1
- data/cuba-libre.gemspec +10 -9
- data/lib/cuba/libre/version.rb +1 -1
- data/lib/cuba/libre.rb +5 -5
- data/spec/cuba_libre_spec.rb +20 -0
- metadata +18 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 084a301d2425bd2ca7b2ba7152861dcf59389ac8
|
|
4
|
+
data.tar.gz: 441be5dc2f4b5bb307c057deab5a65346ae98332
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59879182d43e61d25e8094f8689b8cd8334eb1519d7c68957411520c4b0b3ff8bc2ef35ab2e904528dcfd8c3b7a79406851ccb7f224b64642ec58ca82d04b562
|
|
7
|
+
data.tar.gz: 4b6835cc2c9e34ab8746b0ed8dc3357956dd7debe78f79b627b9f1c377cba8073a8650ed1125c5f2e9fb76e6104a0847f9e6dfa7ee3e7a7af463bfff9092471b
|
data/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Cuba::Libre
|
|
2
2
|
|
|
3
3
|
Cuba-libre is now a cocktail AND a generator to help creating Cuba projects.
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
[Cuba](https://github.com/soveran/cuba) is a micro-framework for Ruby based on Rack.
|
|
5
6
|
|
|
6
7
|
## Installation
|
|
7
8
|
|
|
@@ -24,6 +25,7 @@ Or install it yourself as:
|
|
|
24
25
|
$ cuba new [projectName]
|
|
25
26
|
|
|
26
27
|
This will create your cuba project with its 2 files:
|
|
28
|
+
|
|
27
29
|
* The config.ru to ```rackup```your project.
|
|
28
30
|
* The projectname.rb file that contains your project config and routes.
|
|
29
31
|
|
data/Rakefile
CHANGED
data/bin/cuba
CHANGED
data/cuba-libre.gemspec
CHANGED
|
@@ -4,21 +4,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
require 'cuba/libre/version'
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name =
|
|
7
|
+
spec.name = 'cuba-libre'
|
|
8
8
|
spec.version = Cuba::Libre::VERSION
|
|
9
|
-
spec.authors = [
|
|
10
|
-
spec.email = [
|
|
9
|
+
spec.authors = ['Gregory Durelle']
|
|
10
|
+
spec.email = ['gregory.durelle@gmail.com']
|
|
11
11
|
spec.summary = %q{Generator for Cuba framework.}
|
|
12
12
|
spec.description = %q{Helps create cuba projects through a minimalist generator.}
|
|
13
|
-
spec.homepage =
|
|
14
|
-
spec.license =
|
|
13
|
+
spec.homepage = ''
|
|
14
|
+
spec.license = 'MIT'
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
-
spec.require_paths = [
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
20
|
|
|
21
|
-
spec.add_development_dependency
|
|
22
|
-
spec.add_development_dependency
|
|
23
|
-
spec.add_development_dependency
|
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
23
|
+
spec.add_development_dependency 'cuba', '~> 3.3.0'
|
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.1.0'
|
|
24
25
|
end
|
data/lib/cuba/libre/version.rb
CHANGED
data/lib/cuba/libre.rb
CHANGED
|
@@ -4,7 +4,7 @@ require 'securerandom'
|
|
|
4
4
|
module Cuba
|
|
5
5
|
class Libre
|
|
6
6
|
def initialize(name)
|
|
7
|
-
@project_name = name
|
|
7
|
+
@project_name = name.downcase
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def create_dir
|
|
@@ -18,7 +18,7 @@ module Cuba
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def create_cuba_file
|
|
21
|
-
File.open("./#{@project_name}/#{
|
|
21
|
+
File.open("./#{@project_name}/#{@project_name}.rb", 'w+') do |file|
|
|
22
22
|
file.write setup_cuba
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -52,14 +52,14 @@ Cuba.use Rack::Session::Cookie, :secret => "#{SecureRandom.base64(128)}"
|
|
|
52
52
|
# To launch just type: 'rackup' in your console
|
|
53
53
|
Cuba.define do
|
|
54
54
|
on get do
|
|
55
|
-
on "#{
|
|
55
|
+
on "#{@project_name}" do
|
|
56
56
|
on root do
|
|
57
57
|
res.write 'Hello world!'
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
on root do
|
|
62
|
-
res.redirect "/#{
|
|
62
|
+
res.redirect "/#{@project_name}"
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
65
|
end
|
|
@@ -68,7 +68,7 @@ EOF
|
|
|
68
68
|
|
|
69
69
|
def setup_config
|
|
70
70
|
<<-EOF
|
|
71
|
-
require "./#{
|
|
71
|
+
require "./#{@project_name}"
|
|
72
72
|
|
|
73
73
|
run Cuba
|
|
74
74
|
EOF
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'cuba/libre'
|
|
2
|
+
|
|
3
|
+
describe Cuba::Libre do
|
|
4
|
+
subject { Cuba::Libre.new('myProject') }
|
|
5
|
+
|
|
6
|
+
it 'create_dir' do
|
|
7
|
+
expect(Dir).to receive(:mkdir)
|
|
8
|
+
subject.create_dir
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it 'create_config_file' do
|
|
12
|
+
expect(File).to receive(:open).with('./myproject/config.ru', 'w+')
|
|
13
|
+
subject.create_config_file
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'create_cuba_file' do
|
|
17
|
+
expect(File).to receive(:open).with('./myproject/myproject.rb', 'w+')
|
|
18
|
+
subject.create_cuba_file
|
|
19
|
+
end
|
|
20
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cuba-libre
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gregory Durelle
|
|
@@ -52,6 +52,20 @@ dependencies:
|
|
|
52
52
|
version: 3.3.0
|
|
53
53
|
prerelease: false
|
|
54
54
|
type: :development
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ~>
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: 3.1.0
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - ~>
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: 3.1.0
|
|
67
|
+
prerelease: false
|
|
68
|
+
type: :development
|
|
55
69
|
description: Helps create cuba projects through a minimalist generator.
|
|
56
70
|
email:
|
|
57
71
|
- gregory.durelle@gmail.com
|
|
@@ -69,6 +83,7 @@ files:
|
|
|
69
83
|
- cuba-libre.gemspec
|
|
70
84
|
- lib/cuba/libre.rb
|
|
71
85
|
- lib/cuba/libre/version.rb
|
|
86
|
+
- spec/cuba_libre_spec.rb
|
|
72
87
|
homepage: ''
|
|
73
88
|
licenses:
|
|
74
89
|
- MIT
|
|
@@ -93,4 +108,5 @@ rubygems_version: 2.1.9
|
|
|
93
108
|
signing_key:
|
|
94
109
|
specification_version: 4
|
|
95
110
|
summary: Generator for Cuba framework.
|
|
96
|
-
test_files:
|
|
111
|
+
test_files:
|
|
112
|
+
- spec/cuba_libre_spec.rb
|