cenit-collection-foo 0.0.0
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 +7 -0
- data/.rspec +1 -0
- data/Gemfile +20 -0
- data/LICENSE +26 -0
- data/README.md +285 -0
- data/Rakefile +75 -0
- data/VERSION +1 -0
- data/lib/cenit/collection/foo.rb +35 -0
- data/lib/cenit/collection/foo/build.rb +14 -0
- data/lib/cenit/collection/foo/index.json +7 -0
- data/lib/cenit/collection/foo/libraries/index.json +1 -0
- data/spec/spec_helper.rb +37 -0
- metadata +168 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 84a71e1ac52933f4933aebc6f8f4af3e5272c081
|
4
|
+
data.tar.gz: 6a8c73721993408eebe34b3ef69040fa92956902
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: af439c1842cf6039dbadf9113c2a9ec70cb54ab0334fbcae09c00b9e3d22e71404d80be11bd859096be77d46225a7f4398e84c593cb1ea86c10394957284a4a4
|
7
|
+
data.tar.gz: bbb11f6872726dfd47263929ab47beb7fb6a7072ef0c6bfaa4374e8c07f4d58a1449f3ae58b2c07c1a9615cecae198fbdcb57f5526ffc674c79af37d819d511b
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
gem 'cenit-collection-base'
|
4
|
+
gem 'cenit-client'
|
5
|
+
gem 'activesupport'
|
6
|
+
|
7
|
+
# Include Cenit Collection Gem dependency
|
8
|
+
# gem 'cenit-collection-[My Dependency]'
|
9
|
+
|
10
|
+
# Add dependencies to develop your gem here.
|
11
|
+
# Include everything needed to run rake, tests, features, etc.
|
12
|
+
group :development do
|
13
|
+
gem "rspec", "~> 2.8.0"
|
14
|
+
gem "rdoc", "~> 3.12"
|
15
|
+
gem "bundler", "~> 1.0"
|
16
|
+
gem "jeweler", "~> 2.0.1"
|
17
|
+
gem "simplecov", ">= 0"
|
18
|
+
end
|
19
|
+
|
20
|
+
|
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) 2015 [name of plugin creator]
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
* Neither the name Spree nor the names of its contributors may be used to
|
13
|
+
endorse or promote products derived from this software without specific
|
14
|
+
prior written permission.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
20
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,285 @@
|
|
1
|
+
# CenitCollectionFoo
|
2
|
+
|
3
|
+
Welcome to your new shared collection in this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cenit/collection/foo`. To experiment with that code, rake `console` for an interactive prompt.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'cenit-collection-foo'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install cenit-collection-foo
|
20
|
+
|
21
|
+
### Structure
|
22
|
+
|
23
|
+
```
|
24
|
+
% tree
|
25
|
+
.
|
26
|
+
├── cenit-collection-'cenit-collection-foo'.gemspec
|
27
|
+
├── Gemfile
|
28
|
+
├── .gitignore
|
29
|
+
├── .rspec
|
30
|
+
├── README.md
|
31
|
+
├── Rakefile
|
32
|
+
├── LICENSE
|
33
|
+
└── lib
|
34
|
+
└── cenit
|
35
|
+
└── collection
|
36
|
+
└── 'cenit-collection-foo'
|
37
|
+
└── connections
|
38
|
+
└── webhooks
|
39
|
+
└── connection_sets
|
40
|
+
└── translators
|
41
|
+
└── events
|
42
|
+
└── flows
|
43
|
+
└── libraries
|
44
|
+
└── index.json
|
45
|
+
└── build.rb
|
46
|
+
└── version.rb
|
47
|
+
└── 'cenit-collection-foo'.rb
|
48
|
+
└── spec
|
49
|
+
└── cenit
|
50
|
+
└── collection
|
51
|
+
└── 'cenit-collection-foo'_spec.rb
|
52
|
+
└── spec_helper.rb
|
53
|
+
└── support
|
54
|
+
└── samples
|
55
|
+
|
56
|
+
```
|
57
|
+
|
58
|
+
###Install Shared Collection
|
59
|
+
|
60
|
+
run `bundle exec irb -I lib -r 'cenit/collection/foo'`
|
61
|
+
|
62
|
+
Configure your Cenithub Client API
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
config = {push_url: 'https://www.cenithub.com/api/v1/push',connection_key: 'My Conn Key',connection_token: 'My Conn Token'}
|
66
|
+
```
|
67
|
+
OR
|
68
|
+
|
69
|
+
```ruby
|
70
|
+
config = {push_url: 'https://www.cenithub.com/api/v1/push',user_key: 'My User Key',user_token: 'My User Token'}
|
71
|
+
```
|
72
|
+
Show Hash Collection
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
Cenit::Collection::Foo.show_collection(config)
|
76
|
+
```
|
77
|
+
|
78
|
+
Load Shared Collection into CenitHub
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
Cenit::Collection::Foo.push_collection(config)
|
82
|
+
```
|
83
|
+
|
84
|
+
Setup Shared Collection into CenitHub
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
Cenit::Collection::Foo.pull_collection(config)
|
88
|
+
```
|
89
|
+
Push sample data into Cenithub
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
Cenit::Collection::Foo.push_sample(config)
|
93
|
+
```
|
94
|
+
## Hello, rake tasks
|
95
|
+
|
96
|
+
Beyond just editing source code, you'll be interacting with your gem using `rake` a lot. To see all the tasks available with a brief description, you can run:
|
97
|
+
|
98
|
+
$ rake -T
|
99
|
+
|
100
|
+
You'll need a version before you can start installing your gem locally. The easiest way is with the `version:write` Rake task. Let's imagine you start with 0.1.0
|
101
|
+
|
102
|
+
$ rake version:write MAJOR=0 MINOR=1 PATCH=0
|
103
|
+
|
104
|
+
You can now go forth and develop, now that there's an initial version defined. Eventually, you should install and test the gem:
|
105
|
+
|
106
|
+
$ rake install
|
107
|
+
|
108
|
+
The `install` rake task builds the gem and `gem install`s it. You're all set if you're using [RVM](http://rvm.beginrescueend.com/), but you may need to run it with sudo if you have a system-installed ruby:
|
109
|
+
|
110
|
+
$ sudo rake install
|
111
|
+
|
112
|
+
### Create Git and Github repos
|
113
|
+
|
114
|
+
$ rake create_git_and_github_repo
|
115
|
+
|
116
|
+
### Releasing
|
117
|
+
|
118
|
+
At last, it's time to [ship it](http://shipitsquirrel.github.com/)! Make sure you have everything committed and pushed, then go wild:
|
119
|
+
|
120
|
+
$ rake release
|
121
|
+
|
122
|
+
This will automatically:
|
123
|
+
|
124
|
+
* Generate `hello-gem.gemspec` and commit it
|
125
|
+
* Use `git` to tag `v0.1.0` and push it
|
126
|
+
* Build `hello-gem-0.1.0.gem` and push it to [rubygems.org](http://rubygems.org/gems/)
|
127
|
+
|
128
|
+
`rake release` accepts REMOTE(default: `origin`), LOCAL_BRANCH(default: `master`), REMOTE_BRANCH(default: `master`) and BRANCH(default: master)as options.
|
129
|
+
|
130
|
+
$ rake release REMOTE=upstream LOCAL_BRANCH=critical-security-fix REMOTE_BRANCH=v3
|
131
|
+
|
132
|
+
This will tag and push the commits on your local branch named `critical-security-fix` to branch named `v3` in remote named `upstream` (if you have commit rights
|
133
|
+
on `upstream`) and release the gem.
|
134
|
+
|
135
|
+
$ rake release BRANCH=v3
|
136
|
+
|
137
|
+
If both remote and local branches are the same, use `BRANCH` option to simplify.
|
138
|
+
This will tag and push the commits on your local branch named `v3` to branch named `v3` in remote named `origin` (if you have commit rights
|
139
|
+
on `origin`) and release the gem.
|
140
|
+
|
141
|
+
### Version bumping
|
142
|
+
|
143
|
+
It feels good to release code. Do it, do it often. But before that, bump the version. Then release it. There's a few ways to update the version:
|
144
|
+
|
145
|
+
# version:write like before
|
146
|
+
$ rake version:write MAJOR=0 MINOR=3 PATCH=0
|
147
|
+
|
148
|
+
# bump just major, ie 0.1.0 -> 1.0.0
|
149
|
+
$ rake version:bump:major
|
150
|
+
|
151
|
+
# bump just minor, ie 0.1.0 -> 0.2.0
|
152
|
+
$ rake version:bump:minor
|
153
|
+
|
154
|
+
# bump just patch, ie 0.1.0 -> 0.1.1
|
155
|
+
$ rake version:bump:patch
|
156
|
+
|
157
|
+
Then it's the same `release` we used before:
|
158
|
+
|
159
|
+
$ rake release
|
160
|
+
|
161
|
+
## Customizing your gem
|
162
|
+
|
163
|
+
If you've been following along so far, your gem is just a blank slate. You're going to need to make it colorful and full of metadata.
|
164
|
+
|
165
|
+
You can customize your gem by updating your `Rakefile`. With a newly generated project, it will look something like this:
|
166
|
+
|
167
|
+
require 'jeweler'
|
168
|
+
Jeweler::Tasks.new do |gem|
|
169
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
170
|
+
gem.name = "whatwhatwhat"
|
171
|
+
gem.summary = %Q{TODO: one-line summary of your gem}
|
172
|
+
gem.description = %Q{TODO: longer description of your gem}
|
173
|
+
gem.email = "josh@technicalpickles.com"
|
174
|
+
gem.homepage = "http://github.com/technicalpickles/whatwhatwhat"
|
175
|
+
gem.authors = ["Joshua Nichols"]
|
176
|
+
end
|
177
|
+
Jeweler::RubygemsDotOrgTasks.new
|
178
|
+
|
179
|
+
It's crucial to understand the `gem` object is just a Gem::Specification. You can read up about it at [guides.rubygems.org/specification-reference](http://guides.rubygems.org/specification-reference/). This is the most basic way of specifying a gem, Jeweler-managed or not. Jeweler just exposes this to you, in addition to providing some reasonable defaults, which we'll explore now.
|
180
|
+
|
181
|
+
### Project information
|
182
|
+
|
183
|
+
gem.name = "whatwhatwhat"
|
184
|
+
|
185
|
+
Every gem has a name. Among other things, the gem name is how you are able to `gem install` it. [Reference](http://guides.rubygems.org/specification-reference/#name)
|
186
|
+
|
187
|
+
gem.summary = %Q{TODO: one-line summary of your gem}
|
188
|
+
|
189
|
+
This is a one line summary of your gem. This is displayed, for example, when you use `gem list --details` or view it on [rubygems.org](http://rubygems.org/gems/).
|
190
|
+
|
191
|
+
gem.description = %Q{TODO: longer description of your gem}
|
192
|
+
|
193
|
+
Description is a longer description. Scholars ascertain that knowledge of where the description is used was lost centuries ago.
|
194
|
+
|
195
|
+
gem.email = "josh@technicalpickles.com"
|
196
|
+
|
197
|
+
This should be a way to get a hold of you regarding the gem.
|
198
|
+
|
199
|
+
gem.homepage = "http://github.com/technicalpickles/whatwhatwhat"
|
200
|
+
|
201
|
+
The homepage should have more information about your gem. The jeweler generator guesses this based on the assumption your code lives on [GitHub](http://github.com/), using your Git configuration to find your GitHub username. This is displayed by `gem list --details` and on rubygems.org.
|
202
|
+
|
203
|
+
gem.authors = ["Joshua Nichols"]
|
204
|
+
|
205
|
+
Hey, this is you, the author (or me in this case). The `jeweler` generator also guesses this from your Git configuration. This is displayed by `gem list --details` and on rubygems.org.
|
206
|
+
|
207
|
+
### Files
|
208
|
+
|
209
|
+
The quickest way to add more files is to `git add` them. Jeweler uses your Git repository to populate your gem's files by including added and committed and excluding `.gitignore`d. In most cases, this is reasonable enough.
|
210
|
+
|
211
|
+
If you need to tweak the files, that's cool. Jeweler populates `gem.files` as a `Rake::FileList`. It's like a normal array, except you can `include` and `exclude` file globs:
|
212
|
+
|
213
|
+
gem.files.exclude 'tmp' # exclude temporary directory
|
214
|
+
gem.files.include 'lib/foo/bar.rb' # explicitly include lib/foo/bar.rb
|
215
|
+
|
216
|
+
If that's not enough, you can just set `gem.files` outright
|
217
|
+
|
218
|
+
gem.files = Dir.glob('lib/**/*.rb')
|
219
|
+
|
220
|
+
### Dependencies
|
221
|
+
|
222
|
+
Dependencies let you define other gems that your gem needs to function. `gem install your-gem` will install your-gem's dependencies along with it, and when you use your-gem in an application, the dependencies will be made available. Use `gem.add_dependency` to register them. [Reference](http://guides.rubygems.org/specification-reference/#add_development_dependency)
|
223
|
+
|
224
|
+
gem.add_dependency 'nokogiri'
|
225
|
+
|
226
|
+
This will ensure a version of `nokogiri` is installed, but it doesn't require anything more than that. You can provide extra args to be more specific:
|
227
|
+
|
228
|
+
gem.add_dependency 'nokogiri', '= 1.2.1' # exactly version 1.2.1
|
229
|
+
gem.add_dependency 'nokogiri', '>= 1.2.1' # greater than or equal to 1.2.1, ie, 1.2.1, 1.2.2, 1.3.0, 2.0.0, etc
|
230
|
+
gem.add_dependency 'nokogiri', '>= 1.2.1', '< 1.3.0' # greater than or equal to 1.2.1, but less than 1.3.0
|
231
|
+
gem.add_dependency 'nokogiri', '~> 1.2.1' # same thing, but more concise
|
232
|
+
|
233
|
+
When specifying which version is required, there's a bit of the condunrum. You want to allow the most versions possible, but you want to be sure they are compatible. Using `>= 1.2.1` is fine most of the time, except until the point that 2.0.0 comes out and totally breaks backwards the API. That's when it's good to use `~> 1.2.1`, which requires any version in the `1.2` family, starting with `1.2.1`.
|
234
|
+
|
235
|
+
### Executables
|
236
|
+
|
237
|
+
Executables let your gem install shell commands. Just put any executable scripts in the `bin/` directory, make sure they are added using `git`, and Jeweler will take care of the rest.
|
238
|
+
|
239
|
+
When you need more finely grained control over it, you can set it yourself:
|
240
|
+
|
241
|
+
gem.executables = ['foo'] # note, it's the file name relative to `bin/`, not the project root
|
242
|
+
|
243
|
+
### Versioning
|
244
|
+
|
245
|
+
We discussed earlier how to bump the version. The rake tasks are really just convience methods for manipulating the `VERSION` file. It just contains a version string, like `1.2.3`.
|
246
|
+
|
247
|
+
`VERSION` is a convention used by Jeweler, and is used to populate `gem.version`. You can actually set this yourself, and Jeweler won't try to override it:
|
248
|
+
|
249
|
+
gem.version = '1.2.3'
|
250
|
+
|
251
|
+
A common pattern is to have this in a version constant in your library. This is convenient, because users of the library can query the version they are using at runtime.
|
252
|
+
|
253
|
+
# in lib/foo/version.rb
|
254
|
+
class Foo
|
255
|
+
module Version
|
256
|
+
MAJOR = 1
|
257
|
+
MINOR = 2
|
258
|
+
PATCH = 3
|
259
|
+
BUILD = 'pre3'
|
260
|
+
|
261
|
+
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
# in Rakefile
|
266
|
+
require 'jeweler'
|
267
|
+
require './lib/foo/version.rb'
|
268
|
+
Jeweler::Tasks.new do |gem|
|
269
|
+
# snip
|
270
|
+
gem.version = Foo::Version::STRING
|
271
|
+
end
|
272
|
+
|
273
|
+
## Development
|
274
|
+
|
275
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
276
|
+
|
277
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
278
|
+
|
279
|
+
## Contributing
|
280
|
+
|
281
|
+
1. Fork it ( https://github.com/[my-github-username]/cenit-collection-foo/fork )
|
282
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
283
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
284
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
285
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = 'cenit-collection-foo'
|
18
|
+
gem.license = "MIT"
|
19
|
+
gem.summary = %Q{ Shared Collection cenit-collection-foo }
|
20
|
+
gem.description = %Q{ Shared Collection cenit-collection-foo }
|
21
|
+
gem.author = 'Miguel Sancho'
|
22
|
+
gem.email = 'sanchojaf@gmail.com'
|
23
|
+
gem.homepage = "https://github.com/sanchojaf/cenit-collection-foo"
|
24
|
+
|
25
|
+
# dependencies defined in Gemfile
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
class Jeweler::Generator
|
30
|
+
def target_dir
|
31
|
+
'.'
|
32
|
+
end
|
33
|
+
def create_git_and_github_repo
|
34
|
+
create_version_control
|
35
|
+
create_and_push_repo
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "create a new git and related GitHub's repository'"
|
40
|
+
task :create_repo do
|
41
|
+
options = {
|
42
|
+
project_name: 'cenit-collection-foo',
|
43
|
+
user_name: 'Miguel Sancho',
|
44
|
+
user_email: 'sanchojaf@gmail.com',
|
45
|
+
github_username: 'sanchojaf',
|
46
|
+
testing_framework: :rspec,
|
47
|
+
documentation_framework: :rdoc
|
48
|
+
}
|
49
|
+
g = Jeweler::Generator.new(options)
|
50
|
+
g.create_git_and_github_repo
|
51
|
+
end
|
52
|
+
|
53
|
+
require 'rspec/core'
|
54
|
+
require 'rspec/core/rake_task'
|
55
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
56
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "Code coverage detail"
|
60
|
+
task :simplecov do
|
61
|
+
ENV['COVERAGE'] = "true"
|
62
|
+
Rake::Task['spec'].execute
|
63
|
+
end
|
64
|
+
|
65
|
+
task :default => :spec
|
66
|
+
|
67
|
+
require 'rdoc/task'
|
68
|
+
Rake::RDocTask.new do |rdoc|
|
69
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
70
|
+
|
71
|
+
rdoc.rdoc_dir = 'rdoc'
|
72
|
+
rdoc.title = "cenit-collection-foo #{version}"
|
73
|
+
rdoc.rdoc_files.include('README*')
|
74
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
75
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Cenit
|
2
|
+
module Collection
|
3
|
+
require "cenit/collection/foo/build"
|
4
|
+
require "cenit/client"
|
5
|
+
|
6
|
+
# bundle exec irb -I lib -r 'cenit/collection/foo'
|
7
|
+
# config = {:push_url => "https://www.cenithub.com/api/v1/push", :connection_token => "My Conn Token", :connection_key => "My Conn Key"}
|
8
|
+
# config = {:push_url => "https://www.cenithub.com/api/v1/push", :user_token => "My User Token", :user_key => "My User Key"}
|
9
|
+
# Cenit::Collection::Foo.push_collection config
|
10
|
+
# Cenit::Collection::Foo.shared_collection
|
11
|
+
|
12
|
+
@foo = Cenit::Collection::Foo::Build.new
|
13
|
+
|
14
|
+
# Include Collection Gem dependency
|
15
|
+
# require "cenit/collection/[My Dependency Collection]/build"
|
16
|
+
# Collection dependency
|
17
|
+
# @foo.register_dep(Cenit::Collection::[My Dependency Collection]::Build.new)
|
18
|
+
|
19
|
+
def self.push_collection (config)
|
20
|
+
Cenit::Client.push(@foo.shared_collection.to_json, config)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.show_collection
|
24
|
+
@foo.shared_collection
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.pull_collection (parameters,config)
|
28
|
+
@foo.shared_collection
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.push_sample(model, config)
|
32
|
+
Cenit::Client.push(@foo.sample_data(model).to_json, config)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
[{"name": "Library Name","file": "library_dir"}]
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
|
3
|
+
module SimpleCov::Configuration
|
4
|
+
def clean_filters
|
5
|
+
@filters = []
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
SimpleCov.configure do
|
10
|
+
clean_filters
|
11
|
+
load_adapter 'test_frameworks'
|
12
|
+
end
|
13
|
+
|
14
|
+
ENV["COVERAGE"] && SimpleCov.start do
|
15
|
+
add_filter "/.rvm/"
|
16
|
+
end
|
17
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
18
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
19
|
+
|
20
|
+
require 'rspec'
|
21
|
+
require 'hello-gem'
|
22
|
+
|
23
|
+
require "cenit/collection/foo/build"
|
24
|
+
require 'cenit/client'
|
25
|
+
|
26
|
+
# Requires supporting files with custom matchers and macros, etc,
|
27
|
+
# in ./support/ and its subdirectories.
|
28
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
29
|
+
|
30
|
+
RSpec.configure do |config|
|
31
|
+
|
32
|
+
# Infer an example group's spec type from the file location.
|
33
|
+
config.infer_spec_type_from_file_location!
|
34
|
+
|
35
|
+
config.mock_with :rspec
|
36
|
+
config.color = true
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cenit-collection-foo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Miguel Sancho
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cenit-collection-base
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cenit-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.8.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.8.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rdoc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.12'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.12'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: jeweler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.0.1
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.0.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: " Shared Collection cenit-collection-foo "
|
126
|
+
email: sanchojaf@gmail.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files:
|
130
|
+
- LICENSE
|
131
|
+
- README.md
|
132
|
+
files:
|
133
|
+
- ".rspec"
|
134
|
+
- Gemfile
|
135
|
+
- LICENSE
|
136
|
+
- README.md
|
137
|
+
- Rakefile
|
138
|
+
- VERSION
|
139
|
+
- lib/cenit/collection/foo.rb
|
140
|
+
- lib/cenit/collection/foo/build.rb
|
141
|
+
- lib/cenit/collection/foo/index.json
|
142
|
+
- lib/cenit/collection/foo/libraries/index.json
|
143
|
+
- spec/spec_helper.rb
|
144
|
+
homepage: https://github.com/sanchojaf/cenit-collection-foo
|
145
|
+
licenses:
|
146
|
+
- MIT
|
147
|
+
metadata: {}
|
148
|
+
post_install_message:
|
149
|
+
rdoc_options: []
|
150
|
+
require_paths:
|
151
|
+
- lib
|
152
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
requirements: []
|
163
|
+
rubyforge_project:
|
164
|
+
rubygems_version: 2.2.2
|
165
|
+
signing_key:
|
166
|
+
specification_version: 4
|
167
|
+
summary: Shared Collection cenit-collection-foo
|
168
|
+
test_files: []
|