likeno 0.0.1.rc2 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5999e30bddb7d9b3ca7fe9d4a989c90fb3d1624d
4
- data.tar.gz: 8f312491efd8109ed0f35c8b6d74f546c5f8de33
3
+ metadata.gz: 5ab176898e75da9879337ab0af58d81ec3cfb0ec
4
+ data.tar.gz: f8e4367db3a7c1912b66631ff0c51d00fca58d99
5
5
  SHA512:
6
- metadata.gz: 58c18f82717d45eeaa2b4e22842da8d8a7f9b22c8b5a41c38386afc1debe4f49c59dd433bb11a4185ec8a3358864d68cb59490fc1b140e97f9bc022e6a15ae70
7
- data.tar.gz: 9aede81973991cb206ba085c5802d5d04aed21c0d922fbb8ac0cda98fbb8a233ccc68e9c7ec85cdeae2679c89c3fef61158340164d3677dea2d34ef65e62c0b2
6
+ metadata.gz: 58c95d5df4c84165c6fa070f2201dd129c3bd3760b71cd95861254506ee1964300ce09ae1ab3b95f7dd57af8c2f57c27142b91f137e15c561ca5d1abc3d4b93a
7
+ data.tar.gz: 9fd72126846830c0aa96753f79d4f1f4a0c04c04f6b3693bc19d4f08e9dad9882c9fac4a91c16b5ef50c1c18019e3a6d5d3d0f40f30cad3a9d20afe2cb8d8350
data/README.md CHANGED
@@ -1,16 +1,28 @@
1
1
  # Likeno
2
2
 
3
- Welcome to your new gem! 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/likeno`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Build Status](https://travis-ci.org/mezuro/likeno.png?branch=master)](https://travis-ci.org/mezuro/likeno)
4
+ [![Code Climate](https://codeclimate.com/github/mezuro/likeno.png)](https://codeclimate.com/github/mezuro/likeno)
5
+ [![Test Coverage](https://codeclimate.com/github/mezuro/likeno/badges/coverage.svg)](https://codeclimate.com/github/mezuro/likeno)
4
6
 
5
- TODO: Delete this and the text above, and describe your gem
7
+ Likeno is the Mezuro Team's take on RESTful APIs integration with Rails applications. It tries to mimic ActiveRecord's API.
8
+
9
+ Basically back in 2013, the Mezuro team was getting started with micro services. In order to keep the code clean and following Rails' standards we looked at [active_resource](https://github.com/rails/activeresource) and it proved to not fulfill our requirements about nested objects and [her](https://github.com/remiprev/her) which also has failed the same way. With those frustations in mind we started coding all the CRUD requests using `faraday_middleware` but still giving flexibility for custom requests whenever necessary. Likeno is the final product of this.
10
+
11
+
12
+ It's name come from the fact that by itself Likeno has no purpose at all. It only lives associated to another softwares, providing them with the necessary methods for RESTful APIs. So we can say that Likeno has a symbiosis relation with other applications. This leads us to lichens which are a good symbiosis example. As the Mezuro project has lots of Esperanto words, we finally get to Likeno: is the Esperanto word for lichen.
13
+
14
+ ## Contributing
15
+
16
+ Please, have a look the wiki pages about development workflow and code standards:
17
+
18
+ * https://github.com/mezuro/mezuro/wiki/Development-workflow
19
+ * https://github.com/mezuro/mezuro/wiki/Standards
6
20
 
7
21
  ## Installation
8
22
 
9
23
  Add this line to your application's Gemfile:
10
24
 
11
- ```ruby
12
- gem 'likeno'
13
- ```
25
+ gem 'likeno'
14
26
 
15
27
  And then execute:
16
28
 
@@ -22,15 +34,42 @@ Or install it yourself as:
22
34
 
23
35
  ## Usage
24
36
 
25
- TODO: Write usage instructions here
37
+ Likeno provides default actions for communicating with Rails applications following the scaffold routes. All communication is assumed to use JSON. Specially have a look at the methods from `Likeno::Entity`:
26
38
 
27
- ## Development
39
+ * C `create`
40
+ * R `find` (retrieve)
41
+ * U `update`
42
+ * D `destroy`
28
43
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
44
+ Additionally we provide other useful methods:
30
45
 
31
- 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`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
46
+ * `save` and `save!`
47
+ * `to_hash`
48
+ * `==`
32
49
 
33
- ## Contributing
34
50
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/likeno.
51
+ We hope to make available soon a full documentation on RDoc that will make easier to understand all this.
52
+
53
+ A good example on how to get everything from Likeno should be KalibroClient (https://github.com/mezuro/kalibro_client). So, have a look there for some examples.
54
+
55
+ ### Custom Requests
56
+
57
+ Likeno allows the creation of custom requests. For example:
58
+
59
+ ```ruby
60
+ class MyClass
61
+ def my_custom_request(...)
62
+ action = 'my_action'
63
+ params = {}
64
+ method = :get
65
+ prefix = ''
66
+ Likeno::Entity.request(action, params, method, prefix) # The path used will be '/my_classes/my_action'
67
+ end
68
+ end
69
+ ```
70
+
71
+ It returns a `hash` with the response body.
72
+
73
+ ## Versioning
36
74
 
75
+ Kolekti follows the [semantic versioning](http://semver.org/) policy.
@@ -14,5 +14,5 @@
14
14
  # along with Likeno. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Likeno
17
- VERSION = '0.0.1.rc2'
17
+ VERSION = '0.0.1'
18
18
  end
data/lib/likeno.rb CHANGED
@@ -22,13 +22,15 @@ module Likeno
22
22
 
23
23
  # Configure through hash
24
24
  def self.configure(opts = {})
25
- @config = Hash[opts.map { |name, address| [name.to_sym, address] }]
25
+ opts.each do |name, address|
26
+ @config[name.to_sym] = address
27
+ end
26
28
  end
27
29
 
28
30
  # Configure through yaml file
29
31
  def self.configure_with(path_to_yaml_file)
30
32
  begin
31
- @config = Psych.load_file path_to_yaml_file
33
+ @config.merge!(Psych.load_file(path_to_yaml_file))
32
34
  rescue Errno::ENOENT
33
35
  raise Errno::ENOENT, "YAML configuration file couldn't be found."
34
36
  rescue Psych::Exception
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: likeno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.rc2
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heitor Reis
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2016-03-16 00:00:00.000000000 Z
13
+ date: 2016-03-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -184,9 +184,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  requirements:
187
- - - ">"
187
+ - - ">="
188
188
  - !ruby/object:Gem::Version
189
- version: 1.3.1
189
+ version: '0'
190
190
  requirements: []
191
191
  rubyforge_project:
192
192
  rubygems_version: 2.5.1