pry-globs 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/pry-globs.rb +13 -0
- data/lib/pry-globs/global_variables.yaml +48 -0
- data/lib/pry-globs/globs.rb +19 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 662c6ef41067e82d995cd4cdc7a3efe1bbaba96d
|
4
|
+
data.tar.gz: 228269a71f9199c3fad33198ef3476675c76bfa8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b76d6564450566406ec230e7c0924bce792bc2e3e9bdbbe37c53e6281a2db5a4d8c5e2942508b79f95ed0a45b6d97c267e1daa470ea8158f6694686dc1264e1d
|
7
|
+
data.tar.gz: 3d305b31172f61abc2fd5a582fd8e021ac80562cfdafa0da9f320977a8aec4e0a2d1af511aa7b35c892ebe4b2b55539c2438d97e4eae716f4230fb4071ed9dbf
|
data/lib/pry-globs.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require_relative 'pry-globs/globs'
|
2
|
+
|
3
|
+
Pry::Commands.create_command "globs" do
|
4
|
+
description "Global variables, documented."
|
5
|
+
|
6
|
+
def process
|
7
|
+
if args.size > 1
|
8
|
+
raise Pry::CommandError, "You can pass only one global variable identifier."
|
9
|
+
end
|
10
|
+
|
11
|
+
output.puts Globs.find(args.first)
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
--- # Ruby's global variables
|
2
|
+
$!: The exception information message set by ‘raise’.
|
3
|
+
$@: Array of backtrace of the last exception thrown.
|
4
|
+
$&: The string matched by the last successful match.
|
5
|
+
$`: The string to the left of the last successful match.
|
6
|
+
#$"'": The string to the right of the last successful match.
|
7
|
+
$+: The highest group matched by the last successful match.
|
8
|
+
$1: The Nth group of the last successful match. May be > 1.
|
9
|
+
$~: The information about the last match in the current scope.
|
10
|
+
$=: The flag for case insensitive, nil by default.
|
11
|
+
$/: The input record separator, newline by default.
|
12
|
+
$\: The output record separator for the print and IO#write. Default is nil.
|
13
|
+
$,: The output field separator for the print and Array#join.
|
14
|
+
$;: The default separator for String#split.
|
15
|
+
$.: The current input line number of the last file that was read.
|
16
|
+
$<: The virtual concatenation file of the files given on command line (or from $stdin if no files were given).
|
17
|
+
$>: The default output for print, printf. $stdout by default.
|
18
|
+
$_: The last input line of string by gets or readline.
|
19
|
+
$0: Contains the name of the script being executed. May be assignable.
|
20
|
+
$*: Command line arguments given for the script sans args.
|
21
|
+
$$: The process number of the Ruby running this script.
|
22
|
+
$?: The status of the last executed child process. This value is thread-local.
|
23
|
+
$:: Load path for scripts and binary modules by load or require.
|
24
|
+
$\:: The array contains the module names loaded by require.
|
25
|
+
$-o: The alias to $/
|
26
|
+
$-a: True if option -a is set. Read-only variable.
|
27
|
+
$-d: The alias of $DEBUG.
|
28
|
+
$-F: The alias to $;.
|
29
|
+
$-i: In in-place-edit mode, this variable hods the extension, otherwise nil.
|
30
|
+
$-I: The alias to $:.
|
31
|
+
$-l: True if option -l is set. Read-only varaible.
|
32
|
+
$-p: True if option -p is set. Read-only variable.
|
33
|
+
$-v: An alias of $VERBOSE.
|
34
|
+
$-w: An alias of $VERBOSE.
|
35
|
+
$LOADED_FEATURES: The alias to the $"'".
|
36
|
+
$FILENAME: Current input file from $<. Same as $<.filename.
|
37
|
+
$LOAD_PATH: The alias to the $:.
|
38
|
+
$stderr: The current standard error output.
|
39
|
+
$stding: The current standard input.
|
40
|
+
$stdout: The current standard output.
|
41
|
+
$ARGV: An alias of $*.
|
42
|
+
$VERBOSE: The verbose flag, which is set by the -w or -v switch. Setting this to a true value enables warnings as if -w or -v were given on the command line. Setting this to nil disables warnings, including from Kernel#warn.
|
43
|
+
$DEBUG: The debug flag, which is set by the -d switch. Enabling debug output prints each exception raised to $stderr.
|
44
|
+
ENV: The hash contains current environment variables.
|
45
|
+
ARGV: The alias to the $*.
|
46
|
+
RUBY_VERSION: The ruby version string (VERSION was deprecated).
|
47
|
+
RUBY_RELEASE_DATE: The release date string.
|
48
|
+
RUBY_PLATFORM: The platform identifier.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
class Globs
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def find(global_var)
|
7
|
+
ruby_globals = load_yaml
|
8
|
+
|
9
|
+
return "Unexisting identifier." unless ruby_globals.key?(global_var)
|
10
|
+
|
11
|
+
ruby_globals.fetch(global_var)
|
12
|
+
end
|
13
|
+
|
14
|
+
def load_yaml
|
15
|
+
global_variables_path = File.expand_path('../global_variables.yaml', __FILE__)
|
16
|
+
@ruby_variables ||= YAML.load_file(global_variables_path)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pry-globs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- dariodaic
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- dariodaic5.1@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/pry-globs.rb
|
21
|
+
- lib/pry-globs/global_variables.yaml
|
22
|
+
- lib/pry-globs/globs.rb
|
23
|
+
homepage: https://github.com/dariodaic/pry-globs
|
24
|
+
licenses:
|
25
|
+
- MIT
|
26
|
+
metadata: {}
|
27
|
+
post_install_message:
|
28
|
+
rdoc_options: []
|
29
|
+
require_paths:
|
30
|
+
- lib
|
31
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 2.2.0
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
requirements: []
|
42
|
+
rubyforge_project:
|
43
|
+
rubygems_version: 2.5.1
|
44
|
+
signing_key:
|
45
|
+
specification_version: 4
|
46
|
+
summary: Pry plugin for describing global variables.
|
47
|
+
test_files: []
|
48
|
+
has_rdoc:
|