pry-syslog 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: acff7ee96bc71e35a93fdcaa2b8f0bc12025e2cf
4
+ data.tar.gz: b1f93e92354aacae2a4135c942c3ef2bcb9978e4
5
+ SHA512:
6
+ metadata.gz: 2a3cc4526a9484d6ce9e5200db3f34329e7c9ca847a66df391ec738aa07be32439762ea730e1668723ee79cf5b4dbe5c46aa347fce901b9c29de95b42668a8d6
7
+ data.tar.gz: 2c0a59f11916d2a64d82cb8fef0de7b3b9337a42b3626e996d768b231e395f214ff1246e087c25316554922ace5a0322699700d2c0071ee26eda7f2820263c04
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,6 @@
1
+ RSpec/FilePath:
2
+ Enabled: false
3
+ Style/FileName:
4
+ Enabled: false
5
+ require:
6
+ - rubocop-rspec
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 2.1.5
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --default-return void --private --protected
@@ -0,0 +1,28 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all
4
+ people who contribute through reporting issues, posting feature requests,
5
+ updating documentation, submitting pull requests or patches, and other
6
+ activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, age, or religion.
12
+
13
+ Examples of unacceptable behavior by participants include the use of sexual
14
+ language or imagery, derogatory comments or personal attacks, trolling, public
15
+ or private harassment, insults, or other unprofessional conduct.
16
+
17
+ Project maintainers have the right and responsibility to remove, edit, or
18
+ reject comments, commits, code, wiki edits, issues, and other contributions
19
+ that are not aligned to this Code of Conduct. Project maintainers who do not
20
+ follow the Code of Conduct may be removed from the project team.
21
+
22
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
23
+ reported by opening an issue or contacting one or more of the project
24
+ maintainers.
25
+
26
+ This Code of Conduct is adapted from the [Contributor
27
+ Covenant](http:contributor-covenant.org), version 1.0.0, available at
28
+ [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Sam Stelfox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # PrySyslog
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'pry_syslog'
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install pry-syslog
18
+
19
+ ## Usage
20
+
21
+ ## Contributing
22
+
23
+ I welcome new ideas, bug fixes and comments from anyone and strive to take no
24
+ longer than a week to respond to issues, PRs, or various comments.
25
+
26
+ All code submitted through PRs will be licensed under this project's MIT
27
+ license, if this is a problem please instead open an issue before making your
28
+ changes indicating this and I depending on the request I may make the requested
29
+ changes myself or attempt to convince about the usage of this license. I want
30
+ to avoid a multi-license code base that may impede any individual's usage of
31
+ this code.
32
+
33
+ With all that said, if you'd like to contribute please follow the standard
34
+ contribution guide:
35
+
36
+ 1. Review the [Contributor Code of Conduct][1]
37
+ 2. Fork it ( https://github.com/[my-github-username]/pry_syslog/fork )
38
+ 3. Create your feature branch (`git checkout -b my-new-feature`)
39
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
40
+ 5. Push to the branch (`git push origin my-new-feature`)
41
+ 6. Create a new Pull Request against this repo's develop branch
42
+
43
+ [1]: CODE_OF_CONDUCT.md
data/Rakefile ADDED
@@ -0,0 +1,42 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ rescue LoadError
7
+ puts 'RSpec isn\'t available to the rake environment'
8
+ end
9
+
10
+ begin
11
+ require 'rubocop/rake_task'
12
+ RuboCop::RakeTask.new(:rubocop) do |task|
13
+ task.formatters = %w(simple offenses)
14
+ task.fail_on_error = false
15
+ task.options = %w(--format html --out doc/rubocop.html)
16
+ end
17
+ rescue LoadError
18
+ puts 'Rubocop isn\'t available to the rake environment'
19
+ end
20
+
21
+ begin
22
+ require 'yard'
23
+ YARD::Rake::YardocTask.new(:docs)
24
+ rescue LoadError
25
+ puts 'Yardoc isn\'t available to the rake environment'
26
+ end
27
+
28
+ task :default do
29
+ Rake::Task[:docs].invoke if Rake::Task.task_defined?(:docs)
30
+ Rake::Task[:rubocop].invoke if Rake::Task.task_defined?(:rubocop)
31
+ Rake::Task[:spec].invoke if Rake::Task.task_defined?(:spec)
32
+ end
33
+
34
+ task 'environment' do
35
+ require 'pry-syslog'
36
+ end
37
+
38
+ desc 'Run a console with the application loaded'
39
+ task console: [:environment] do
40
+ require 'pry'
41
+ pry
42
+ end
@@ -0,0 +1,5 @@
1
+ # :nodoc:
2
+ module PrySyslog
3
+ # The current version of PrySyslog
4
+ VERSION = '0.1.0'
5
+ end
data/lib/pry-syslog.rb ADDED
@@ -0,0 +1,26 @@
1
+ require 'pry'
2
+ require 'pry-syslog/version'
3
+ require 'syslog/logger'
4
+
5
+ # Parent namespace of the pry-syslog gem.
6
+ module PrySyslog
7
+ def self.announce_logging
8
+ puts 'All commands executed in this session will be logged to syslog.'
9
+ end
10
+
11
+ def self.log_code_execution(code)
12
+ syslog.info(code)
13
+ end
14
+
15
+ def self.syslog
16
+ @syslog ||= ::Syslog::Logger.new('pry_history', Syslog::LOG_LOCAL1)
17
+ end
18
+ end
19
+
20
+ Pry.config.hooks.add_hook(:before_session, :logged_warning) do
21
+ PrySyslog.announce_logging
22
+ end
23
+
24
+ Pry.config.hooks.add_hook(:before_eval, :log_code_execution) do |code|
25
+ PrySyslog.log_code_execution(code)
26
+ end
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
6
+ require 'pry-syslog/version'
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = 'pry-syslog'
10
+ spec.version = PrySyslog::VERSION
11
+ spec.authors = ['Sam Stelfox']
12
+ spec.email = ['sstelfox@bedroomprogrammers.net']
13
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f =~ /^spec\// }
14
+
15
+ spec.summary = 'A small gem that hooks the pry history to send ' \
16
+ 'executed commands to syslog for auditing purposes.'
17
+ spec.description = spec.summary
18
+ spec.homepage = 'https://github.com/sstelfox/pry_syslog'
19
+ spec.license = 'MIT'
20
+
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_dependency 'pry', '~> 0.10.0'
24
+
25
+ spec.add_development_dependency 'bundler', '~> 1.8'
26
+ spec.add_development_dependency 'rake', '~> 10.0'
27
+
28
+ spec.add_development_dependency 'rspec'
29
+ spec.add_development_dependency 'coveralls'
30
+ spec.add_development_dependency 'simplecov'
31
+
32
+ spec.add_development_dependency 'rdoc'
33
+ spec.add_development_dependency 'redcarpet'
34
+ spec.add_development_dependency 'yard'
35
+
36
+ spec.add_development_dependency 'rubocop'
37
+ spec.add_development_dependency 'rubocop-rspec'
38
+ end
metadata ADDED
@@ -0,0 +1,214 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pry-syslog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sam Stelfox
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.10.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.10.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rdoc
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: redcarpet
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: yard
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: A small gem that hooks the pry history to send executed commands to syslog
168
+ for auditing purposes.
169
+ email:
170
+ - sstelfox@bedroomprogrammers.net
171
+ executables: []
172
+ extensions: []
173
+ extra_rdoc_files: []
174
+ files:
175
+ - ".gitignore"
176
+ - ".rspec"
177
+ - ".rubocop.yml"
178
+ - ".travis.yml"
179
+ - ".yardopts"
180
+ - CODE_OF_CONDUCT.md
181
+ - Gemfile
182
+ - LICENSE.txt
183
+ - README.md
184
+ - Rakefile
185
+ - lib/pry-syslog.rb
186
+ - lib/pry-syslog/version.rb
187
+ - pry-syslog.gemspec
188
+ homepage: https://github.com/sstelfox/pry_syslog
189
+ licenses:
190
+ - MIT
191
+ metadata: {}
192
+ post_install_message:
193
+ rdoc_options: []
194
+ require_paths:
195
+ - lib
196
+ required_ruby_version: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
201
+ required_rubygems_version: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ requirements: []
207
+ rubyforge_project:
208
+ rubygems_version: 2.4.3
209
+ signing_key:
210
+ specification_version: 4
211
+ summary: A small gem that hooks the pry history to send executed commands to syslog
212
+ for auditing purposes.
213
+ test_files: []
214
+ has_rdoc: