sapis 0.2.0 → 0.3.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -177
  3. data/lib/sapis/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 706da212069932f59f12a8d9cd682f7587181423cd1d986a3e3846276e174673
4
- data.tar.gz: ce7f341ed2fbff980f82f56face8887db95f5e3456b80f9248c0096479620817
3
+ metadata.gz: 52b3ca66bfcde6713ac1c84026d2a92b65d3438581f549c740ec61551c849778
4
+ data.tar.gz: 52777650753a8d17c9bd82afd557f3bc2ca98477beb26dad28cb262fd2694342
5
5
  SHA512:
6
- metadata.gz: 60bfb16b91ea5dac5c0b25486b7612a7311b5b2657127be887009b2c0a7768c0be729c3fb7fd746e33e4a3d4a351a8b7a42e24a4a71476494008e27f6812a28b
7
- data.tar.gz: 96d251fa4d9c21e36bff0e9380ff431ed4603d35f56e5024a2f634a6511bd32e9054ee383560029f6a625cc269e984c450f0d0db23cb10590c006e4d00a7eb47
6
+ metadata.gz: 2176d3ac1427fd9a9db7e0df494ba4d66af2f795b75743d87ce03467e5570fcb00a0716be2b7bcb28f59755c54f6a5ef7522af2d033a7ad381cf849aeb067540
7
+ data.tar.gz: 32fd64559a032787ca5154673ee4b7d866a61e1110bbf2b131da75bc367d9c2004b8f73ac69a36b4adc98667c5e68951d4fb7de37cc05ec4796a4e05743f5d04
data/README.md CHANGED
@@ -1,179 +1,3 @@
1
1
  # Sapis
2
2
 
3
- Sav's APIs - A collection of Ruby utility helpers for various tasks including graphing, configuration management, concurrency, system operations, multimedia handling, and more.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'sapis'
11
- ```
12
-
13
- And then execute:
14
-
15
- ```bash
16
- bundle install
17
- ```
18
-
19
- Or install it yourself as:
20
-
21
- ```bash
22
- gem install sapis
23
- ```
24
-
25
- ## Usage
26
-
27
- Require the gem in your Ruby code:
28
-
29
- ```ruby
30
- require 'sapis'
31
- ```
32
-
33
- ### Available Modules
34
-
35
- #### GraphingHelper
36
-
37
- Provides functionality for creating and formatting graphs using Gruff.
38
-
39
- ```ruby
40
- # Transpose data and create line graphs
41
- data, days = GraphingHelper.transpose_data_top_headers( source_data )
42
- GraphingHelper.format_as_line_graph( data, days, out_file: 'graph.png' )
43
-
44
- # Format data as tables
45
- table = GraphingHelper.format_as_table( rows, separator: '|', align: { 'Header' => :left } )
46
- ```
47
-
48
- #### ConfigurationHelper
49
-
50
- Load configuration from files with optional encryption support.
51
-
52
- ```ruby
53
- config = ConfigurationHelper.load_configuration( group: 'myapp', sym_keys: true )
54
- value = config[ :some_key ]
55
- ```
56
-
57
- #### ConcurrencyHelper
58
-
59
- Parallel processing with thread pooling.
60
-
61
- ```ruby
62
- ConcurrencyHelper.with_parallel_queue( 4 ) do | queue, semaphore |
63
- queue.push { task_1 }
64
- queue.push { task_2 }
65
- end
66
- ```
67
-
68
- #### GenericHelper
69
-
70
- General utility functions including date decoding and retry logic.
71
-
72
- ```ruby
73
- date = GenericHelper.decode_date( 'today' )
74
- GenericHelper.do_retry( max_retries: 3, sleep: 1 ) { risky_operation }
75
- ```
76
-
77
- #### BashHelper
78
-
79
- Safe execution of bash commands.
80
-
81
- ```ruby
82
- result = BashHelper.safe_execute( 'ls -la' )
83
- BashHelper.simple_bash_execute( 'rm', file1, file2, file3 )
84
- ```
85
-
86
- #### ComputationsHelper
87
-
88
- Data manipulation and smoothing functions.
89
-
90
- ```ruby
91
- ComputationsHelper.convert_to_incremental_values!( values )
92
- ComputationsHelper.smooth_line!( values, 5 )
93
- ```
94
-
95
- #### DesktopHelper
96
-
97
- Desktop integration utilities.
98
-
99
- ```ruby
100
- DesktopHelper.set_clipboard_text( 'Hello, World!' )
101
- result = DesktopHelper.display_dialog( 'Are you sure?' )
102
- DesktopHelper.desktop_notification( 'Task completed' )
103
- ```
104
-
105
- #### InteractionsHelper
106
-
107
- Command-line user interaction helpers.
108
-
109
- ```ruby
110
- password = InteractionsHelper.secure_ask( 'Enter password: ' )
111
- answer = InteractionsHelper.ask_entry( 'Name', 'default_name' )
112
- choice = InteractionsHelper.ask_entries_with_points( 'Select option', options )
113
- ```
114
-
115
- #### MultimediaHelper
116
-
117
- Audio and multimedia file operations.
118
-
119
- ```ruby
120
- MultimediaHelper.play_audio_file( 'song.mp3' )
121
- MultimediaHelper.normalize_songs( file1, file2 )
122
- MultimediaHelper.create_m3u_playlist( files, basedir, 'playlist.m3u' )
123
- ```
124
-
125
- #### GnomeHelper
126
-
127
- GNOME desktop environment helpers.
128
-
129
- ```ruby
130
- GnomeHelper.set_gnome_background( '/path/to/image.jpg' )
131
- current = GnomeHelper.get_gnome_background_filename
132
- ```
133
-
134
- #### SystemHelper
135
-
136
- System-level utilities.
137
-
138
- ```ruby
139
- cores = SystemHelper.system_cores_number
140
- files = SystemHelper.find_files( '*.rb', [ '/path' ], file_type: SystemHelper::SEARCH_FILES )
141
- SystemHelper.open_file( 'document.pdf' )
142
- ```
143
-
144
- #### SQLiteLayer
145
-
146
- Simplified SQLite database operations.
147
-
148
- ```ruby
149
- db = SQLiteLayer.new( 'database.db' )
150
- id = db.insert_values( 'users', { name: 'John', email: 'john@example.com' } )
151
- results = db.select_all( 'SELECT * FROM users WHERE active = ?', true )
152
- db.transaction do
153
- # database operations
154
- end
155
- db.close
156
- ```
157
-
158
- ## Dependencies
159
-
160
- - gruff (~> 0.7) - For graphing functionality
161
- - parseconfig (~> 1.0) - For configuration file parsing
162
- - highline (~> 2.0) - For secure command-line input
163
- - sqlite3 (~> 1.4) - For SQLite database operations
164
-
165
- ## Development
166
-
167
- After checking out the repo, run `bundle install` to install dependencies.
168
-
169
- ## License
170
-
171
- This project is licensed under the GNU General Public License v3.0. See the source files for full license text.
172
-
173
- ## Author
174
-
175
- Saverio Miroddi
176
-
177
- ## Contributing
178
-
179
- Bug reports and pull requests are welcome on GitHub.
3
+ Sav's APIs - A collection of Ruby utility helpers I wrote for myself.
data/lib/sapis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sapis
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saverio Miroddi
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '2.0'
46
+ version: 3.1.2
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '2.0'
53
+ version: 3.1.2
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: sqlite3
56
56
  requirement: !ruby/object:Gem::Requirement