every_day_irb 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 244188d18a787358db20562d891644c53daf6dc6
4
- data.tar.gz: 9aa78fd37e995acf0eee2452f9cd0261221fe1e9
2
+ SHA256:
3
+ metadata.gz: c4bf811a35caf66a1fef10a52f9fb3f234c6050bedb1797e4026f20f72e40e27
4
+ data.tar.gz: 2cb5ec001f658c697e1caaa9137abfc0e5c949828dafed70f31117980b227af4
5
5
  SHA512:
6
- metadata.gz: 95518798918ce370df0bae9e216b68c375094b4fea251728e0dd4307015e04143985648d01b8ad5fb46d1af3311d5fc18603a1bc89554706c4ae34ce0f205f9d
7
- data.tar.gz: b4c9d2df4dbaa5d99938b9b39e0eec26501466b8f672ffa5f951c47b5fc2e46da14e9ca61232ccafa4e039fb8f47217bcefeeecde76df9fb1e6fdf840228e90f
6
+ metadata.gz: 9ad2ffdca08455a4c9eb204a93b386460b470f29357890dd4fa3637433623b2ab783a656d1bfb64673bba589306eeefcfdaec21ec41150ba94dd769a05ba7a2c
7
+ data.tar.gz: 2a5045aa4a9f5bb41ddd74b0a6144e958a10a0512579b6d0a56a8b21d3ae45622026b4554c722847967b40c4862ba9f7b630c3be0b3aa071792b832c6d58cead
@@ -0,0 +1,2 @@
1
+ Gemfile.lock
2
+ /pkg
@@ -0,0 +1,18 @@
1
+ sudo: false
2
+ language: ruby
3
+
4
+ rvm:
5
+ - 2.6
6
+ - 2.5
7
+ - 2.4
8
+ - 2.3
9
+ - ruby-head
10
+ - jruby-9.2.6.0
11
+ - truffleruby
12
+
13
+ matrix:
14
+ allow_failures:
15
+ - rvm: ruby-head
16
+ - rvm: truffleruby
17
+ - rvm: 2.3
18
+ # fast_finish: true
@@ -0,0 +1,13 @@
1
+ ## CHANGELOG
2
+
3
+ ### 2.1.0
4
+
5
+ - Separate every_day_irb into its own git repository
6
+ - No code changes
7
+
8
+ ### 2.0.0
9
+
10
+ - Separate every_day_irb's release cycle from irbtool release cycle
11
+ - Move cd enhancements into cd microgem on which every_day_irb depends
12
+ - You must extend EveryDayIrb explicitly, does not happen on require, anymore
13
+ - Add rr for require_relative
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at opensource@janlelis.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "rspec", "~> 3.2"
6
+ gem "rake"
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2015 Jan Lelis
1
+ Copyright (c) 2010-2019 Jan Lelis
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,195 +1,38 @@
1
- # Irbtools [![version](https://badge.fury.io/rb/irbtools.svg)](http://badge.fury.io/rb/irbtools)
1
+ # Every day… IRB [![[version]](https://badge.fury.io/rb/every_day_irb.svg)](http://badge.fury.io/rb/every_day_irb) [![[travis]](https://travis-ci.org/janlelis/every_day_irb.svg)](https://travis-ci.org/janlelis/every_day_irb)
2
2
 
3
- _ _| | | |
4
- | __| __ \ __| _ \ _ \ | __|
5
- | | | | | ( | ( | | \__ \
6
- ___| _| _.__/ \__| \___/ \___/ _| ____/
7
-
8
-
9
- Improvements for Ruby's IRB console, like colored output and a lot of
10
- debugging and introspection methods. Unlike with PRY, you are still in your
11
- normal IRB. It is designed to work out-of-the-box, so there is no reason to not
12
- use it!
3
+ Provides utility methods useful in IRB, like a `rq` method for requiring libraries, or `ls` for showing the list of files of the current directory. Part of [Irbtools](https://irb.tools).
13
4
 
14
5
  ## Setup
15
6
 
16
- $ gem install irbtools
17
-
18
- IRB executes code in `~/.irbrc` on start-up. If the file does not exist, yet,
19
- just create a new one. Add the following content:
20
-
21
- require 'irbtools'
22
-
23
- You also need to add irbtools to your project's Gemfile:
24
-
25
- gem 'irbtools', require: 'irbtools/binding'
26
-
27
- Then start IRB (with **Irbtools** loaded) from the console or directly from your code with:
28
-
29
- binding.irb
30
-
31
- If the `binding_of_caller` gem is available (e.g. see below), you can omit the `binding`:
32
-
33
- irb
34
-
35
- ### More Improvements
36
-
37
- Some suggested gems will not be installed to ensure wider general support. For
38
- the full feature set, you can add **irbtools-more** and change your
39
- `.irbrc` to:
40
-
41
- require 'irbtools/more'
42
-
43
- and edit your Gemfile to
44
-
45
- gem 'irbtools-more', require: 'irbtools/binding'
46
-
47
-
48
- ### Included Gems and Libraries
49
- #### IRB Improvements
50
-
51
- * Colored output:
52
- [wirb](https://github.com/janlelis/wirb/)
53
- [fanycy_irb](https://github.com/janlelis/fancy_irb)
54
- * Custom views for specific objects:
55
- [hirb](http://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html)
56
- * **(irbtools-more)** Correction suggestions for misspelled method/constant names:
57
- [did_you_mean](https://github.com/yuki24/did_you_mean)
58
- * **(irbtools-more)** Better tab-completion:
59
- [bond](http://tagaholic.me/bond/)
60
-
61
- #### Utils
62
-
63
- * Useful IRB commands (see below):
64
- [every_day_irb](https://github.com/janlelis/irbtools/tree/master/lib/every
65
- _day_irb.rb)
66
- [debugging](https:/github.com/janlelis/debugging)
67
- [fileutils](http://ruby-doc.org/stdlib-2.2.1/libdoc/fileutils/rdoc/FileUtils.html)
68
- * Clipboard Access:
69
- [clipboard](https://github.com/janlelis/clipboard)
70
- * Terminal colors:
71
- [paint](https://github.com/janlelis/paint)
72
- * Load an editor into your IRB session:
73
- [interactive_editor](https://github.com/jberkel/interactive_editor)
74
-
75
- #### Introspection
76
-
77
- * Displays a method's source:
78
- [code](https://github.com/janlelis/code)
79
- * Access to `ri` docs:
80
- [ori](https://github.com/dadooda/ori)
81
- * Manipulate instance variables with ease:
82
- [instance](https://github.com/rubyworks/instance/)
83
- * Platform information:
84
- [ruby_version](https://github.com/janlelis/ruby_version)
85
- [ruby_engine](https://github.com/janlelis/ruby_engine)
86
- [os](https://github.com/rdp/os)
87
- [ruby_info](https://github.com/janlelis/ruby_info)
88
- * Improved method lookup path inspection:
89
- [method_locator](https://github.com/ryanlecompte/method_locator)
90
- * Finds methods that turn one value into another value:
91
- [methodfinder](https://github.com/citizen428/methodfinder)
92
- * **irbtools-more** Awesome lookup path inspection:
93
- [looksee](https://github.com/oggy/looksee)
94
-
95
-
96
- ### Irbtools Methods
97
-
98
- Besides improving IRB itself, you will get the following methods:
99
-
100
- Method | Arguments | Description
101
- ------ | ---------- | -----------
102
- `beep` | | Ring terminal bell.
103
- `cat` | path | Read file contents.
104
- `cd` | path = nil | Changes the directory. Can also be used in these forms: `~cd` (change to home directory), `-cd` (change to previous directory).
105
- `clear` | | Clear the terminal.
106
- `code` | object = self, method_name | Display the method source with syntax highlighting. Will also look up C methods if the **core_docs** gem is available.
107
- `colorize` | string | Syntax highlight a Ruby string.
108
- `copy` | string | Copy something to the clipboard.
109
- `copy_input` | | Copy session history to the clipboard.
110
- `copy_output` | | Copy session output history to the clipboard.
111
- `ed` / `emacs` / `mate` / `mvim` / `nano` / `vi` / `vim` | filename = nil | Start an editor in the session context.
112
- `engine` | | Show the Ruby engine.
113
- `g` | *args | Like `Kernel#p`, but using terminal-notifier or growl.
114
- `howtocall` | object = self, method_or_proc | Displays parameter names and types for a proc or method.
115
- `info` | | List general information about the Ruby environment.
116
- `ld` | file | Shortcut for `load lib.to_s + '.rb'`.
117
- `ls` | path = "." | List directory content.
118
- `mf` | object1, object2 | Find methods that turn one value into another value:w
119
- `mof` | object, depth = 0, grep = // | Print a method list, ordered by modules.
120
- `os` | | Query operating system information.
121
- `pa` | string, color | Print a string in the specified color.
122
- `page` | what, options = {} | Page long content.
123
- `paste` | | Paste clipboard content.
124
- `q` | *args | Like `Kernel#p`, but prints results on one line, with different colors.
125
- `ray` | path | Syntax highlight a Ruby file.
126
- `re` | string, regexg, groups = nil | Assists you when matching regexes againts strings.
127
- `reset!` | | Restart the current IRB session.
128
- `rq` | lib | Shortcut for `require lib.to_s`. Use it like this: `rq:prime`.
129
- `rrq` / `rerequire` | lib | Hack to remove a library from `$LOADED_FEATURES` and `require` it again.
130
- `session_history` | number_of_lines = nil | Return a string of all commands issued in the current session.
131
- `version` | | Show the Ruby version.
132
- `wp` | inspect_string | Syntax-highlight a Ruby object.
133
- `Object#instance` | | Proxy object to read and manipulate instance variables / run eval.
134
- `Object#lp` | | **irbtools-more** Supercharged method introspection in IRB
135
- `Object#mlp` / `Object#method_lookup_path` | | Traverse an object's method lookup path to find all places where a method may be defined.
136
- `Object#ri` | *args | Show ri documentation for this object or method.
137
-
138
-
139
- ### Advanced tweaking
140
-
141
- See [CONFIGURE.md](https://github.com/janlelis/irbtools/blob/master/CONFIGURE.md).
142
-
143
-
144
- ### Troubleshooting: ANSI colors on Windows
145
-
146
- Windows: ANSI support can be enabled via
147
- [ansicon](https://github.com/adoxa/ansicon) or
148
- [ConEmu](http://code.google.com/p/conemu-maximus5/).
149
-
150
-
151
- ### Troubleshooting: Clipboard not working on Linux
152
-
153
- Clipboard support requires **xclip** or **xsel**. On ubuntu, do: `sudo apt-get
154
- install xclip`
155
-
156
-
157
- ### Troubleshooting: Unicode causes wrong display widths
158
-
159
- If you use double-width unicode characterss, you will need to paste the
160
- following snippet to your `.irbrc` file.
161
-
162
- Irbtools.replace_library_callback :fancy_irb do
163
- FancyIrb.start east_asian_width: true
164
- end
165
-
166
- This setting is deactivated by default, because of performance issues.
167
-
168
-
169
- ### Hint: Debundle
170
-
171
- If you do not want to add **Irbtools** to your project's Gemfile, you will need a
172
- [debundle hack](https://github.com/janlelis/debundle.rb). Put it at the
173
- beginning of your `~/.irbrc` file and you are fine (until it breaks).
7
+ Add to your `Gemfile`:
174
8
 
9
+ ```ruby
10
+ gem "every_day_irb"
11
+ ```
175
12
 
176
- ### Hint: No ANSI / IRB extension
13
+ ## Usage
177
14
 
178
- You can use Irbtools without colors/irb extensions. To do so, put this into `~/.irbrc`:
15
+ Execute this:
179
16
 
180
17
  ```ruby
181
- require 'irbtools/non_fancy'
182
- Irbtools.start
18
+ extend EveryDayIrb
183
19
  ```
184
20
 
21
+ to get the following methods:
185
22
 
186
- ### Hint: Web Console
187
-
188
- **Irbtools** works well together with the amazing
189
- [web-console!](https://github.com/rails/web-console)
23
+ - ls(path = '.')
24
+ - cd(path = nil)
25
+ - cat(path)
26
+ - rq(lib)
27
+ - rr(lib)
28
+ - ld(lib)
29
+ - rerequire(lib)
30
+ - clear
31
+ - reset!
32
+ - session_history(number_of_lines = nil)
190
33
 
34
+ More info at the [Irbtools README](https://github.com/janlelis/irbtools#irbtools-methods) and in the [specs](https://github.com/janlelis/every_day_irb/blob/master/spec/every_day_irb_spec.rb).
191
35
 
192
- ## J-_-L
36
+ ## MIT License
193
37
 
194
- Copyright (c) 2010-2015 Jan Lelis <http://janlelis.com> released under the MIT
195
- license.
38
+ Copyright (C) 2010-2019 Jan Lelis <http://janlelis.com>. Released under the MIT license.
@@ -0,0 +1,41 @@
1
+ # # #
2
+ # Get gemspec info
3
+
4
+ gemspec_file = Dir["*.gemspec"].first
5
+ gemspec = eval File.read(gemspec_file), binding, gemspec_file
6
+ info = "#{gemspec.name} | #{gemspec.version} | " \
7
+ "#{gemspec.runtime_dependencies.size} dependencies | " \
8
+ "#{gemspec.files.size} files"
9
+
10
+ # # #
11
+ # Gem build and install task
12
+
13
+ desc info
14
+ task :gem do
15
+ puts info + "\n\n"
16
+ print " "; sh "gem build #{gemspec_file}"
17
+ FileUtils.mkdir_p "pkg"
18
+ FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
19
+ puts; sh %{gem install --no-document pkg/#{gemspec.name}-#{gemspec.version}.gem}
20
+ end
21
+
22
+ # # #
23
+ # Start an IRB session with the gem loaded
24
+
25
+ desc "#{gemspec.name} | IRB"
26
+ task :irb do
27
+ sh "irb -I ./lib -r #{gemspec.name.gsub '-','/'}"
28
+ end
29
+
30
+ # # #
31
+ # Run specs
32
+
33
+ require "rspec/core/rake_task"
34
+
35
+ RSpec::Core::RakeTask.new(:spec) do |t|
36
+ t.rspec_opts = '--backtrace --color'
37
+ end
38
+
39
+ task default: :spec
40
+
41
+
@@ -1,28 +1,22 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.dirname(__FILE__) + '/lib/every_day_irb/version'
3
2
 
4
- Gem::Specification.new do |s|
5
- s.name = 'every_day_irb'
6
- s.version = EveryDayIrb::VERSION
3
+ require File.dirname(__FILE__) + "/lib/every_day_irb/version"
7
4
 
8
- s.homepage = 'http://github.com/janlelis/irbtools'
9
- s.authors = ["Jan Lelis"]
10
- s.summary = 'EveryDayIrb simplifies daily life in IRB.'
11
- s.description = 'EveryDayIrb simplifies daily life in IRB with commands like: ls, cat, rq, rrq, ld, reset!, ...'
12
- s.email = 'mail@janlelis.de'
13
- s.files = %w[
14
- lib/every_day_irb.rb
15
- lib/every_day_irb/version.rb
16
- spec/every_day_irb_spec.rb
17
- every_day_irb.gemspec
18
- ]
19
- s.extra_rdoc_files = %w[
20
- README.md
21
- CHANGELOG-EVERYDAYIRB.txt
22
- MIT-LICENSE.txt
23
- ]
24
- s.license = 'MIT'
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "every_day_irb"
7
+ gem.version = EveryDayIrb::VERSION
8
+ gem.summary = "EveryDayIrb simplifies daily life in IRB."
9
+ gem.description = "EveryDayIrb simplifies daily life in IRB with commands like: ls, cat, rq, rrq, ld, reset!, ..."
10
+ gem.authors = ["Jan Lelis"]
11
+ gem.email = ["mail@janlelis.de"]
12
+ gem.homepage = "https://irb.tools"
13
+ gem.license = "MIT"
25
14
 
26
- s.required_ruby_version = '~> 2.0'
27
- s.add_dependency 'cd', '~> 1.0'
15
+ gem.files = Dir["{**/}{.*,*}"].select{ |path| File.file?(path) && path !~ /^pkg/ }
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.required_ruby_version = "~> 2.0"
21
+ gem.add_dependency 'cd', '~> 1.0'
28
22
  end
@@ -79,4 +79,3 @@ module EveryDayIrb
79
79
  Readline::HISTORY.entries[-number_of_lines...-1]*"\n"
80
80
  end
81
81
  end
82
-
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EveryDayIrb
2
- VERSION = "2.0.0".freeze
4
+ VERSION = "2.1.0"
3
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: every_day_irb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-29 00:00:00.000000000 Z
11
+ date: 2019-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cd
@@ -26,22 +26,25 @@ dependencies:
26
26
  version: '1.0'
27
27
  description: 'EveryDayIrb simplifies daily life in IRB with commands like: ls, cat,
28
28
  rq, rrq, ld, reset!, ...'
29
- email: mail@janlelis.de
29
+ email:
30
+ - mail@janlelis.de
30
31
  executables: []
31
32
  extensions: []
32
- extra_rdoc_files:
33
- - README.md
34
- - CHANGELOG-EVERYDAYIRB.txt
35
- - MIT-LICENSE.txt
33
+ extra_rdoc_files: []
36
34
  files:
37
- - CHANGELOG-EVERYDAYIRB.txt
35
+ - ".gitignore"
36
+ - ".travis.yml"
37
+ - CHANGELOG.md
38
+ - CODE_OF_CONDUCT.md
39
+ - Gemfile
38
40
  - MIT-LICENSE.txt
39
41
  - README.md
42
+ - Rakefile
40
43
  - every_day_irb.gemspec
41
44
  - lib/every_day_irb.rb
42
45
  - lib/every_day_irb/version.rb
43
46
  - spec/every_day_irb_spec.rb
44
- homepage: http://github.com/janlelis/irbtools
47
+ homepage: https://irb.tools
45
48
  licenses:
46
49
  - MIT
47
50
  metadata: {}
@@ -60,9 +63,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
63
  - !ruby/object:Gem::Version
61
64
  version: '0'
62
65
  requirements: []
63
- rubyforge_project:
64
- rubygems_version: 2.4.6
66
+ rubygems_version: 3.0.3
65
67
  signing_key:
66
68
  specification_version: 4
67
69
  summary: EveryDayIrb simplifies daily life in IRB.
68
- test_files: []
70
+ test_files:
71
+ - spec/every_day_irb_spec.rb
@@ -1,5 +0,0 @@
1
- 2.0.0
2
- * Separate every_day_irb release cycle from irbtools release cycle
3
- * Move cd enhancements into cd microgem on which every_day_irb depends
4
- * You must extend EveryDayIrb explicitely, does not happen on require, anymore
5
- * Add rr for require_relative