rbtils 0.0.1 → 0.0.2
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/CONTRIBUTE.md +13 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +27 -0
- data/README.md +18 -0
- data/bin/rbtils +36 -0
- data/lib/constants.rb +1 -1
- data/logs/.gitignore +4 -0
- data/rbtils.gemspec +13 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc141db7cfb9ade02f28f86571a940b3926b2b42
|
4
|
+
data.tar.gz: 90bdaa0ad423dfd1d19bf2aa2f3dd7e659bb9dfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f9f7e7390f0d4598c3145c9699c8c25fb461d1f1185cd4e28fb44ef20076a08a036a5e8f0136d289686ed05f954696e9ad0bddca021656b8970b2949c169dd9
|
7
|
+
data.tar.gz: c88cc28bf5899cfbe123eccfd74f077a65a02e69cd4fe72230715f6848a26c9fec6ec6e335f9e85f77110948b125b6cf1386a614d5465dbe47f12eb7d694011a
|
data/CONTRIBUTE.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contribute!
|
2
|
+
|
3
|
+
These tools are designed to be easily extendable to handle any sort of functionality you need.
|
4
|
+
|
5
|
+
## Creating a New Controller
|
6
|
+
|
7
|
+
Commands are processed by controllers, which call three class methods: `pre_exec`, `exec` then `post_exec`. The router looks for your handler in the `Granify::Controller` namespace (see [lib/controllers/open.rb](lib/controllers/open.rb) for an example). `pre_exec` and `post_exec` are mainly used by the base controller to execute predefined profiling and cleanup tasks. If you want to overwrite them in your controller, make sure you add `super` so it still calls the parent class method.
|
8
|
+
|
9
|
+
|Handler method|Description|
|
10
|
+
|--------------|-----------|
|
11
|
+
|pre_exec|Designed to create shell script help text, can be used to run code before Controller::exec is executed.|
|
12
|
+
|exec|Automatically executes the requested method, if it exists.|
|
13
|
+
|post_exec|Execute post-run hooks. By default, old log files are deleted.|
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ast (2.0.0)
|
5
|
+
astrolabe (1.3.0)
|
6
|
+
parser (>= 2.2.0.pre.3, < 3.0)
|
7
|
+
evernote-thrift (1.25.1)
|
8
|
+
notifaction (0.0.7)
|
9
|
+
parser (2.2.0.3)
|
10
|
+
ast (>= 1.1, < 3.0)
|
11
|
+
powerpack (0.1.0)
|
12
|
+
rainbow (2.0.0)
|
13
|
+
rubocop (0.29.1)
|
14
|
+
astrolabe (~> 1.3)
|
15
|
+
parser (>= 2.2.0.1, < 3.0)
|
16
|
+
powerpack (~> 0.1)
|
17
|
+
rainbow (>= 1.99.1, < 3.0)
|
18
|
+
ruby-progressbar (~> 1.4)
|
19
|
+
ruby-progressbar (1.7.5)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
evernote-thrift
|
26
|
+
notifaction
|
27
|
+
rubocop
|
data/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Rbtils
|
2
|
+
|
3
|
+
Helpful utilities to improve your personal workflow. To extend it's functionality, please read the [contribution](CONTRIBUTE.md) document.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
1. `gem install rbtils`
|
8
|
+
2. Execute `rbtils branch current` to test if everything installed correctly
|
9
|
+
|
10
|
+
## How to Use
|
11
|
+
|
12
|
+
|Command|Description|Usage|
|
13
|
+
|--------------|-----------|--------------|
|
14
|
+
|branch|Show information about git branches you are working on|`rbtils branch current`, `rbtils branch recent`|
|
15
|
+
|clean|Manually cleanup old logs in `./logs/*`|`rbtils clean`|
|
16
|
+
|minify|Minify, rename and move all coffeescript/javascript to a /min folder in the current directory|`rbtils minify js`|
|
17
|
+
|open|Open a list of files in your favourite editor|`rbtils open files *files`|
|
18
|
+
|hound|Check your ruby or CS/JS code for syntax and convention issues|`rbtils hound js`|
|
data/bin/rbtils
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "time"
|
5
|
+
require "json"
|
6
|
+
require "optparse"
|
7
|
+
require "rbconfig"
|
8
|
+
require "net/http"
|
9
|
+
require "uri"
|
10
|
+
require "fileutils"
|
11
|
+
require "cgi"
|
12
|
+
require "notifaction"
|
13
|
+
|
14
|
+
# include required files
|
15
|
+
require_relative "../lib/helpers/time.rb"
|
16
|
+
require_relative "../lib/config.rb"
|
17
|
+
require_relative "../lib/request.rb"
|
18
|
+
require_relative "../lib/log.rb"
|
19
|
+
require_relative "../lib/constants.rb"
|
20
|
+
require_relative "../lib/utils.rb"
|
21
|
+
require_relative "../lib/logs.rb"
|
22
|
+
require_relative "../lib/command.rb"
|
23
|
+
require_relative "../lib/model_data.rb"
|
24
|
+
require_relative "../lib/controller.rb"
|
25
|
+
require_relative "../lib/router.rb"
|
26
|
+
require_relative "../lib/model.rb"
|
27
|
+
require_relative "../lib/helper.rb"
|
28
|
+
|
29
|
+
# Modify configuration options here
|
30
|
+
$config = Granify::Cfg.new
|
31
|
+
# Bootstrap!
|
32
|
+
$config.bootstrap!
|
33
|
+
|
34
|
+
# Config file located, route the request
|
35
|
+
req = Granify::Router.new
|
36
|
+
req.route
|
data/lib/constants.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Granify
|
2
2
|
PACKAGE_NAME = "rbtils"
|
3
|
-
INSTALLED_DIR =
|
3
|
+
INSTALLED_DIR = Gem::Specification.find_by_name(Granify::PACKAGE_NAME).gem_dir
|
4
4
|
LOG_DIR = INSTALLED_DIR + "/logs"
|
5
5
|
DEFAULT_LOG = Log.new # no args means default log
|
6
6
|
HELPER_DIR = INSTALLED_DIR + "/lib/helpers/"
|
data/logs/.gitignore
ADDED
data/rbtils.gemspec
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'rbtils'
|
3
|
+
s.version = '0.0.2'
|
4
|
+
s.date = '2015-07-03'
|
5
|
+
s.summary = "Utilities for your CLI workflow"
|
6
|
+
s.description = "A set of utilities that can be used independently of other projects"
|
7
|
+
s.authors = ["Ryan Priebe"]
|
8
|
+
s.email = 'hello@ryanpriebe.com'
|
9
|
+
s.files = `git ls-files`.split($\)
|
10
|
+
s.homepage = 'http://rubygems.org/gems/rbtils'
|
11
|
+
s.license = 'MIT'
|
12
|
+
s.executables = 'rbtils'
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbtils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Priebe
|
@@ -12,10 +12,16 @@ date: 2015-07-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
13
13
|
description: A set of utilities that can be used independently of other projects
|
14
14
|
email: hello@ryanpriebe.com
|
15
|
-
executables:
|
15
|
+
executables:
|
16
|
+
- rbtils
|
16
17
|
extensions: []
|
17
18
|
extra_rdoc_files: []
|
18
19
|
files:
|
20
|
+
- CONTRIBUTE.md
|
21
|
+
- Gemfile
|
22
|
+
- Gemfile.lock
|
23
|
+
- README.md
|
24
|
+
- bin/rbtils
|
19
25
|
- lib/command.rb
|
20
26
|
- lib/config.rb
|
21
27
|
- lib/configs/coffeelint.json
|
@@ -37,6 +43,9 @@ files:
|
|
37
43
|
- lib/request.rb
|
38
44
|
- lib/router.rb
|
39
45
|
- lib/utils.rb
|
46
|
+
- logs/.gitignore
|
47
|
+
- logs/default.log
|
48
|
+
- rbtils.gemspec
|
40
49
|
homepage: http://rubygems.org/gems/rbtils
|
41
50
|
licenses:
|
42
51
|
- MIT
|