plugzapi-gem 0.1.0 → 0.1.1
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 +0 -71
- data/lib/plugzapi/gem/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce0aee4f8077df6cf6d8216fcfb89a4f6c7a4f8c179335f6dd0076774a961624
|
4
|
+
data.tar.gz: 3098e0d745a93cbb21966bb85114673973660c14cba9b9d5c83cdcff3f94f3ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d40f255a028026c86706106226ee046f3152782717a13fc0b47fa401d6409a717c80e6599b114681b4a7922afc7d993a701edc9352f34fd12271fc41a497e875
|
7
|
+
data.tar.gz: 88fe9bab28203b891603c8ac046fd64874118191710e995d8568d3e271cabed2ef24027b85347a3982ea310ddccdaf5d354d27b02eac61cff7959e05647700a3
|
data/README.md
CHANGED
@@ -1,91 +1,20 @@
|
|
1
1
|
# Plugzapi::Gem
|
2
2
|
|
3
|
-
TODO: Delete this and the text below, and describe your gem
|
4
|
-
|
5
|
-
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/plugzapi/gem`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
3
|
|
7
4
|
## Installation
|
8
5
|
|
9
|
-
Para instalar a gem no projeto basta adicionar o seguinte trecho no Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
...
|
13
|
-
gem 'pegar_o_path_que_vai_gerar_no_gitlab'
|
14
|
-
```
|
15
|
-
|
16
|
-
Para testar localmente é possível instalar a gem executando o seguinte comando no terminal:
|
17
|
-
|
18
|
-
```bash
|
19
|
-
gem install ./plugzapi-gem.gem
|
20
|
-
```
|
21
|
-
|
22
|
-
instalando a gem é preciso criar um initializer para passar algumas variaveis para gem. Segue um exemplo:
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
Plugzapi.configure do |config|
|
26
|
-
config.first_value = "primeiro valor"
|
27
|
-
config.second_value = "segundo valor"
|
28
|
-
end
|
29
|
-
```
|
30
6
|
|
31
7
|
## Usage
|
32
8
|
|
33
9
|
|
34
10
|
## Development
|
35
11
|
|
36
|
-
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.
|
37
|
-
|
38
|
-
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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
39
|
-
|
40
|
-
O desenvolvimento se concentra dentro da pasta lib/plugzapi. Seguindo a estrutura que temos de exemplo na classe Soma que fica dentro do Calculator.
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
module Plugzapi
|
44
|
-
module Calculator
|
45
|
-
class Soma
|
46
|
-
attr_reader :value1, :value2
|
47
|
-
|
48
|
-
def self.perform(value1, value2)
|
49
|
-
new(value1, value2).call
|
50
|
-
end
|
51
|
-
|
52
|
-
def initialize(value1, value2)
|
53
|
-
@value1 = value1
|
54
|
-
@value2 = value2
|
55
|
-
end
|
56
|
-
|
57
|
-
def call
|
58
|
-
puts value1 + value2
|
59
|
-
puts "---------------"
|
60
|
-
Plugzapi.configuration.valor_dos_parametros
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
```
|
66
|
-
|
67
|
-
Segue um exemplo de como usar essa classe em uma aplicação que possui a gem instalada e configurada:
|
68
|
-
|
69
|
-
```ruby
|
70
|
-
Plugzapi::Calculator::Soma.perform(4, 6)
|
71
|
-
```
|
72
|
-
|
73
|
-
Isso vai retornar o seguinte:
|
74
|
-
|
75
|
-
```bash
|
76
|
-
10
|
77
|
-
---------------
|
78
|
-
first_value = primeiro valor
|
79
|
-
second_value = segundo valor
|
80
|
-
```
|
81
12
|
|
82
13
|
## Contributing
|
83
14
|
|
84
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/plugzapi-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/plugzapi-gem/blob/master/CODE_OF_CONDUCT.md).
|
85
15
|
|
86
16
|
## Code of Conduct
|
87
17
|
|
88
|
-
Everyone interacting in the Plugzapi::Gem project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/plugzapi-gem/blob/master/CODE_OF_CONDUCT.md).
|
89
18
|
|
90
19
|
## License
|
91
20
|
|
data/lib/plugzapi/gem/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plugzapi-gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keslley
|
@@ -67,7 +67,7 @@ files:
|
|
67
67
|
- lib/plugzapi/send_message.rb
|
68
68
|
- lib/plugzapi/validate_phone.rb
|
69
69
|
- sig/plugzapi/gem.rbs
|
70
|
-
homepage:
|
70
|
+
homepage:
|
71
71
|
licenses:
|
72
72
|
- MIT
|
73
73
|
metadata:
|