activerse 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3f87b8fda678a8ab7c759cede469f763fb274a32fb4175e5880c57dd5a727d7
4
- data.tar.gz: db6972302af44ff6904b39487c4dffa8673c2bfb2796e9a01472a6448328bf44
3
+ metadata.gz: dfb241edaaa82e22cbaa17ac7642f0d0ebb02d14bed881eb5b3f32eb705b98da
4
+ data.tar.gz: 3ae2d19824dd3d2db2de8af7d8bc054197c54a94b9764115be93e474889aca0b
5
5
  SHA512:
6
- metadata.gz: 790f6fac64046ba696e21f1fe5cdb829393bf53ac491fae52234fb81a81ae7b688db6258b4aa98ba93b340a71dd9b3a3e7c0c9bcdf338a7db5788d9ccae59a4b
7
- data.tar.gz: 3bb700d7ad6c5cd353562c6d462a447c3f88c68ef11decab45e4b264116ebb0f3f19efaef734cd9db975940b13a61b6f1356aa0ba12d3c016aa58c2dff6ed68f
6
+ metadata.gz: dc897ab1d448e08d4c4bf9b4c0ba2c2d2494ae8b00c34315b5d0147d6cbf57824ab642cf267d2ac95c8bcc2e9e4d1c6391914b50550246535ab07cd14cb95115
7
+ data.tar.gz: 842159d114a3733fdae848c38cd3c21554e62d84c32a72743ad791ab3660c34bb3006fa7db668e1a7af6dd28d49884edd50b743519a0809d1c7abca8381011c5
data/README.md CHANGED
@@ -1,11 +1,7 @@
1
- # WIP: Activerse
1
+ # Activerse
2
2
  [![Gem Version](https://badge.fury.io/rb/activerse.svg)](https://badge.fury.io/rb/activerse)
3
3
  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/fe0e9c2138d24d10a268e72491562fec)](https://www.codacy.com/manual/pietromoro/activerse?utm_source=github.com&utm_medium=referral&utm_content=pietromoro/activerse&utm_campaign=Badge_Grade)
4
4
 
5
- This gem is currently in the process of being made.
6
-
7
- **DISCLAMER** All text is either temporary or not yet implemented. It is only a proposal of how the library could work
8
-
9
5
  <a href="https://www.buymeacoffee.com/pietromoro" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
10
6
 
11
7
  ## Usage
@@ -23,6 +19,12 @@ end
23
19
  ```
24
20
  See the wiki for more informations.
25
21
 
22
+
23
+ When ready to fill your credentials run:
24
+ ```bash
25
+ $ rails g activerse:fill
26
+ ```
27
+
26
28
  In the `config/initializers/activese.rb` file you can specify more general settings.
27
29
 
28
30
  See the wiki or directly the initializer file for more configuration options.
@@ -49,13 +51,13 @@ To create all necessary setup and files run:
49
51
  $ rails g activerse:install
50
52
  ```
51
53
 
52
- When ready to fill your credentials run:
53
- ```bash
54
- $ rails g activerse:fill
55
- ```
56
-
57
54
  ## Contributing
58
- Contributions will be welome when first few iterations will be going out.
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/pietromoro/activerse. 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/pietromoro/activerse/blob/master/CODE_OF_CONDUCT.md).
59
56
 
60
57
  ## License
61
58
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
59
+
60
+
61
+ ## Code of Conduct
62
+
63
+ Everyone interacting in the Activerse project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/pietromoro/activerse/blob/master/CODE_OF_CONDUCT.md).
@@ -10,7 +10,7 @@ module Activerse
10
10
  guess = `tput cols`.to_i
11
11
  guess == 0 ? 80 : guess
12
12
  puts " #{title.to_s} ".center(guess, '=')
13
- @current_keys.push sym.nil? ? title.to_sym : sym.to_sym
13
+ @current_keys.push sym.nil? ? title.parameterize.underscore.to_sym : sym.to_sym
14
14
  instance_eval(&block)
15
15
  @current_keys.pop
16
16
  puts '-' * guess
@@ -26,6 +26,11 @@ module Activerse
26
26
  last = @current_keys.inject(@credentials) { |structure, key| structure[key] ||= {} }
27
27
  last[key.to_sym] = to
28
28
  end
29
+
30
+ def get key
31
+ last = @current_keys.inject(@credentials) { |structure, key| structure[key] ||= {} }
32
+ last[key.to_sym]
33
+ end
29
34
 
30
35
  def ask question, echo: true
31
36
  print question + " "
@@ -43,9 +48,13 @@ module Activerse
43
48
  last[key.to_sym] = response.blank? ? last_value : response
44
49
  end
45
50
 
46
- def save_to_database model, *args
47
- model.create!(*args)
48
- set model.to_sym, to: true
51
+ def default key, to:
52
+ set key, to: to if get(key).nil?
53
+ end
54
+
55
+ def save_to_database model, with: {}
56
+ model.create!(with)
57
+ set model.to_s.underscore.to_sym, to: true
49
58
  end
50
59
  end
51
60
  end
@@ -1,3 +1,3 @@
1
1
  module Activerse
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pietro Moro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-27 00:00:00.000000000 Z
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: 1.4.1
41
41
  description: Rails gem that allows a project to be distributed over multiple companies,
42
42
  without having to set specific credentials in a file, allowing to distribute only
43
- it's structure with a web ui.
43
+ it's structure, fillable whitin the terminal with a single command.
44
44
  email:
45
45
  - pietromoro@programmer.net
46
46
  executables: []
@@ -63,7 +63,9 @@ files:
63
63
  homepage: https://github.com/pietromoro/activerse
64
64
  licenses:
65
65
  - MIT
66
- metadata: {}
66
+ metadata:
67
+ homepage_uri: https://github.com/pietromoro/activerse
68
+ source_code_uri: https://github.com/pietromoro/activerse
67
69
  post_install_message:
68
70
  rdoc_options: []
69
71
  require_paths:
@@ -72,15 +74,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
74
  requirements:
73
75
  - - ">="
74
76
  - !ruby/object:Gem::Version
75
- version: '0'
77
+ version: 2.3.0
76
78
  required_rubygems_version: !ruby/object:Gem::Requirement
77
79
  requirements:
78
80
  - - ">="
79
81
  - !ruby/object:Gem::Version
80
82
  version: '0'
81
83
  requirements: []
82
- rubygems_version: 3.1.4
84
+ rubygems_version: 3.0.3
83
85
  signing_key:
84
86
  specification_version: 4
85
- summary: Generate initial settings and configurations with a web interface.
87
+ summary: Generate initial settings and configurations within your terminal.
86
88
  test_files: []