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 +4 -4
- data/README.md +50 -11
- data/lib/likeno/version.rb +1 -1
- data/lib/likeno.rb +4 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ab176898e75da9879337ab0af58d81ec3cfb0ec
|
4
|
+
data.tar.gz: f8e4367db3a7c1912b66631ff0c51d00fca58d99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58c95d5df4c84165c6fa070f2201dd129c3bd3760b71cd95861254506ee1964300ce09ae1ab3b95f7dd57af8c2f57c27142b91f137e15c561ca5d1abc3d4b93a
|
7
|
+
data.tar.gz: 9fd72126846830c0aa96753f79d4f1f4a0c04c04f6b3693bc19d4f08e9dad9882c9fac4a91c16b5ef50c1c18019e3a6d5d3d0f40f30cad3a9d20afe2cb8d8350
|
data/README.md
CHANGED
@@ -1,16 +1,28 @@
|
|
1
1
|
# Likeno
|
2
2
|
|
3
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
39
|
+
* C `create`
|
40
|
+
* R `find` (retrieve)
|
41
|
+
* U `update`
|
42
|
+
* D `destroy`
|
28
43
|
|
29
|
-
|
44
|
+
Additionally we provide other useful methods:
|
30
45
|
|
31
|
-
|
46
|
+
* `save` and `save!`
|
47
|
+
* `to_hash`
|
48
|
+
* `==`
|
32
49
|
|
33
|
-
## Contributing
|
34
50
|
|
35
|
-
|
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.
|
data/lib/likeno/version.rb
CHANGED
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
|
-
|
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
|
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
|
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-
|
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:
|
189
|
+
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
192
|
rubygems_version: 2.5.1
|