connfu-client 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/Gemfile.lock +3 -1
- data/README.rdoc +1 -1
- data/bin/connfu-client +11 -2
- data/connfu-client.gemspec +1 -0
- data/lib/connfu/cli/generator.rb +7 -3
- data/lib/connfu/version.rb +1 -1
- metadata +40 -28
data/.travis.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm: 1.9.2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
connfu-client (0.1)
|
4
|
+
connfu-client (0.1.2)
|
5
5
|
activesupport (~> 3.0.8)
|
6
6
|
gli
|
7
7
|
rest-client
|
@@ -63,6 +63,7 @@ GEM
|
|
63
63
|
i18n
|
64
64
|
ruby-progressbar
|
65
65
|
ruby_parser
|
66
|
+
rake (0.9.2)
|
66
67
|
rcov (0.9.10)
|
67
68
|
rdoc (3.9.4)
|
68
69
|
reek (1.2.8)
|
@@ -112,6 +113,7 @@ DEPENDENCIES
|
|
112
113
|
flog (~> 2.5.1)
|
113
114
|
metric_fu
|
114
115
|
metrical
|
116
|
+
rake
|
115
117
|
reek (~> 1.2.8)
|
116
118
|
roodi (~> 2.1.0)
|
117
119
|
rspec
|
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
== Welcome to
|
1
|
+
== Welcome to connfu-client {<img src="http://travis-ci.org/bluevialabs/connfu-client.png" />}[http://travis-ci.org/bluevialabs/connfu-client]
|
2
2
|
|
3
3
|
connFu gem provides an easy way to get access to connFu platform using the defined DSL and the provisioning API.
|
4
4
|
|
data/bin/connfu-client
CHANGED
@@ -28,6 +28,10 @@ EOS
|
|
28
28
|
|
29
29
|
arg_name "project_name"
|
30
30
|
command :scaffold do |c|
|
31
|
+
c.desc 'Application token'
|
32
|
+
c.default_value nil
|
33
|
+
c.flag :t
|
34
|
+
|
31
35
|
c.desc 'Channels the application should listen to'
|
32
36
|
c.default_value nil
|
33
37
|
c.flag :c
|
@@ -48,7 +52,12 @@ command :scaffold do |c|
|
|
48
52
|
end
|
49
53
|
|
50
54
|
c.flags.each do |f|
|
51
|
-
usage << "\n -#{f[0]}: #{f[1].description}.
|
55
|
+
usage << "\n -#{f[0]}: #{f[1].description}."
|
56
|
+
if f[1].default_value.nil?
|
57
|
+
usage << " (Optional parameter)"
|
58
|
+
else
|
59
|
+
usage << " Default value: #{f[1].default_value}"
|
60
|
+
end
|
52
61
|
end
|
53
62
|
|
54
63
|
usage << "\n\n"
|
@@ -57,7 +66,7 @@ command :scaffold do |c|
|
|
57
66
|
end
|
58
67
|
puts " #{green("create")} #{args[0]}"
|
59
68
|
|
60
|
-
Connfu::Cli::Generator.run(args[0], options[:c], options[:f])
|
69
|
+
Connfu::Cli::Generator.run(args[0], options[:c], options[:f], options[:t])
|
61
70
|
|
62
71
|
puts " #{green("create")} #{options[:f]}"
|
63
72
|
|
data/connfu-client.gemspec
CHANGED
data/lib/connfu/cli/generator.rb
CHANGED
@@ -59,7 +59,7 @@ END
|
|
59
59
|
##
|
60
60
|
# This application is an example of how to create a connFu application
|
61
61
|
|
62
|
-
token = "
|
62
|
+
token = "%{token}"
|
63
63
|
|
64
64
|
Connfu.logger = STDOUT
|
65
65
|
Connfu.log_level = Logger::INFO
|
@@ -77,9 +77,10 @@ END
|
|
77
77
|
# * **name** application name
|
78
78
|
# * **channels** channels the application should listen to
|
79
79
|
# * **file_name** main file that will hold the application logic
|
80
|
+
# * **token** connFu application token
|
80
81
|
#
|
81
82
|
# ==== Return
|
82
|
-
def run(name, channels = nil, file_name = "application.rb")
|
83
|
+
def run(name, channels = nil, file_name = "application.rb", token = nil)
|
83
84
|
|
84
85
|
channels.is_a?(String) and channels = channels.split.map{|channel| channel.to_sym}
|
85
86
|
|
@@ -93,7 +94,10 @@ END
|
|
93
94
|
channels.delete_if{|channel| !Connfu::ListenerChannel::CHANNEL_TYPES.include?(channel)}
|
94
95
|
channels = channels.map{|item| channels_templates[item]}.join
|
95
96
|
end
|
96
|
-
values = {
|
97
|
+
values = {
|
98
|
+
:channels => channels,
|
99
|
+
:token => (token.nil? || token.empty?) ? "YOUR-VALID-CONNFU-TOKEN" : token
|
100
|
+
}
|
97
101
|
|
98
102
|
code.gsub!(/%\{(\w+)\}/) do |match|
|
99
103
|
key = $1
|
data/lib/connfu/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: connfu-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2011-09-
|
13
|
+
date: 2011-09-30 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
17
|
-
requirement: &
|
17
|
+
requirement: &2152345960 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.0.8
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2152345960
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rest-client
|
28
|
-
requirement: &
|
28
|
+
requirement: &2152344940 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2152344940
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rspec
|
39
|
-
requirement: &
|
39
|
+
requirement: &2152343700 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2152343700
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: flog
|
50
|
-
requirement: &
|
50
|
+
requirement: &2152342580 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 2.5.1
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2152342580
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: flay
|
61
|
-
requirement: &
|
61
|
+
requirement: &2152341620 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 1.4.2
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *2152341620
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: roodi
|
72
|
-
requirement: &
|
72
|
+
requirement: &2152340500 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 2.1.0
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *2152340500
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: reek
|
83
|
-
requirement: &
|
83
|
+
requirement: &2152336640 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,10 +88,10 @@ dependencies:
|
|
88
88
|
version: 1.2.8
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *2152336640
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
93
|
name: simplecov
|
94
|
-
requirement: &
|
94
|
+
requirement: &2152335400 !ruby/object:Gem::Requirement
|
95
95
|
none: false
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
@@ -99,10 +99,10 @@ dependencies:
|
|
99
99
|
version: 0.4.0
|
100
100
|
type: :development
|
101
101
|
prerelease: false
|
102
|
-
version_requirements: *
|
102
|
+
version_requirements: *2152335400
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: webmock
|
105
|
-
requirement: &
|
105
|
+
requirement: &2152334360 !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
108
108
|
- - ! '>='
|
@@ -110,10 +110,10 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
|
-
version_requirements: *
|
113
|
+
version_requirements: *2152334360
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
115
|
name: sdoc
|
116
|
-
requirement: &
|
116
|
+
requirement: &2152332840 !ruby/object:Gem::Requirement
|
117
117
|
none: false
|
118
118
|
requirements:
|
119
119
|
- - ! '>='
|
@@ -121,10 +121,10 @@ dependencies:
|
|
121
121
|
version: '0'
|
122
122
|
type: :development
|
123
123
|
prerelease: false
|
124
|
-
version_requirements: *
|
124
|
+
version_requirements: *2152332840
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: metric_fu
|
127
|
-
requirement: &
|
127
|
+
requirement: &2152331340 !ruby/object:Gem::Requirement
|
128
128
|
none: false
|
129
129
|
requirements:
|
130
130
|
- - ! '>='
|
@@ -132,10 +132,10 @@ dependencies:
|
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
|
-
version_requirements: *
|
135
|
+
version_requirements: *2152331340
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
137
|
name: metrical
|
138
|
-
requirement: &
|
138
|
+
requirement: &2152329160 !ruby/object:Gem::Requirement
|
139
139
|
none: false
|
140
140
|
requirements:
|
141
141
|
- - ! '>='
|
@@ -143,10 +143,21 @@ dependencies:
|
|
143
143
|
version: '0'
|
144
144
|
type: :development
|
145
145
|
prerelease: false
|
146
|
-
version_requirements: *
|
146
|
+
version_requirements: *2152329160
|
147
|
+
- !ruby/object:Gem::Dependency
|
148
|
+
name: rake
|
149
|
+
requirement: &2152326400 !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
type: :development
|
156
|
+
prerelease: false
|
157
|
+
version_requirements: *2152326400
|
147
158
|
- !ruby/object:Gem::Dependency
|
148
159
|
name: gli
|
149
|
-
requirement: &
|
160
|
+
requirement: &2152325260 !ruby/object:Gem::Requirement
|
150
161
|
none: false
|
151
162
|
requirements:
|
152
163
|
- - ! '>='
|
@@ -154,7 +165,7 @@ dependencies:
|
|
154
165
|
version: '0'
|
155
166
|
type: :runtime
|
156
167
|
prerelease: false
|
157
|
-
version_requirements: *
|
168
|
+
version_requirements: *2152325260
|
158
169
|
description: This gem provides a smooth access to connFu capabilities
|
159
170
|
email:
|
160
171
|
- devs@connfu.com
|
@@ -166,6 +177,7 @@ extra_rdoc_files: []
|
|
166
177
|
files:
|
167
178
|
- .rspec
|
168
179
|
- .rvmrc
|
180
|
+
- .travis.yml
|
169
181
|
- Gemfile
|
170
182
|
- Gemfile.lock
|
171
183
|
- LICENSE.txt
|