cute_print 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.config/cucumber.yml +1 -0
  3. data/.rspec +1 -0
  4. data/.yardopts +6 -0
  5. data/Gemfile +18 -0
  6. data/Gemfile.lock +99 -0
  7. data/LICENSE +20 -0
  8. data/README.md +109 -0
  9. data/Rakefile +14 -0
  10. data/VERSION +1 -0
  11. data/basic101.gemspec +64 -0
  12. data/cute_print.gemspec +96 -0
  13. data/features/.nav +6 -0
  14. data/features/configuring/configure_output.feature +21 -0
  15. data/features/configuring/configure_position_format.feature +30 -0
  16. data/features/configuring/readme.md +1 -0
  17. data/features/configuring/reset_configuration.feature +27 -0
  18. data/features/inspect_call_chain.feature +39 -0
  19. data/features/inspect_objects/inspect.feature +29 -0
  20. data/features/inspect_objects/label_and_inspect.feature +16 -0
  21. data/features/inspect_objects/print_source_location.feature +41 -0
  22. data/features/inspect_objects/readme.md +1 -0
  23. data/features/readme.md +1 -0
  24. data/features/support/env.rb +9 -0
  25. data/features/support/helpers/example.rb +54 -0
  26. data/features/support/helpers/temp_dir.rb +15 -0
  27. data/features/support/step_definitions.rb +23 -0
  28. data/lib/cute_print/configure.rb +37 -0
  29. data/lib/cute_print/core_ext/object.rb +5 -0
  30. data/lib/cute_print/core_ext.rb +1 -0
  31. data/lib/cute_print/default_printer.rb +14 -0
  32. data/lib/cute_print/finds_foreign_caller.rb +19 -0
  33. data/lib/cute_print/mixin.rb +44 -0
  34. data/lib/cute_print/printer.rb +106 -0
  35. data/lib/cute_print/ruby_generator.rb +17 -0
  36. data/lib/cute_print/ruby_parser/block.rb +12 -0
  37. data/lib/cute_print/ruby_parser/method_call.rb +27 -0
  38. data/lib/cute_print/ruby_parser/parsed_code.rb +38 -0
  39. data/lib/cute_print/ruby_parser/wraps_sexp.rb +19 -0
  40. data/lib/cute_print/ruby_parser.rb +60 -0
  41. data/lib/cute_print/stderr_out.rb +13 -0
  42. data/lib/cute_print.rb +26 -0
  43. data/spec/cute_print_spec.rb +69 -0
  44. data/spec/printer_spec.rb +64 -0
  45. data/spec/spec_helper.rb +13 -0
  46. data/spec/support/captures_stderr.rb +5 -0
  47. data/tasks/cucumber.rake +8 -0
  48. data/tasks/default.rake +1 -0
  49. data/tasks/jeweler.rake +29 -0
  50. data/tasks/spec.rake +5 -0
  51. data/tasks/test.rake +2 -0
  52. data/tasks/yard.rake +3 -0
  53. data/test_support/captures_stderr.rb +16 -0
  54. data/test_support/captures_stdout.rb +16 -0
  55. metadata +130 -0
@@ -0,0 +1,13 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+
4
+ require "pp"
5
+ require "rspec"
6
+ require "rspec-given"
7
+
8
+ # Requires supporting files with custom matchers and macros, etc,
9
+ # in ./support/ and its subdirectories.
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
11
+
12
+ RSpec.configure do |config|
13
+ end
@@ -0,0 +1,5 @@
1
+ require_relative "../../test_support/captures_stderr"
2
+
3
+ RSpec.configure do |c|
4
+ c.include CapturesStderr
5
+ end
@@ -0,0 +1,8 @@
1
+ require "cucumber/rake/task"
2
+
3
+ Cucumber::Rake::Task.new "test:cucumber" do |t|
4
+ t.fork = true
5
+ t.cucumber_opts = "--format progress"
6
+ end
7
+
8
+ task "cucumber" => ["test:cucumber"]
@@ -0,0 +1 @@
1
+ task :default => [:test]
@@ -0,0 +1,29 @@
1
+ # encoding: utf-8
2
+
3
+ require 'jeweler'
4
+
5
+ def readme
6
+ File.read(File.join(File.dirname(__FILE__), '../README.md'))
7
+ end
8
+
9
+ def description
10
+ unless (desc = readme[/\A#[^\n]*\n*(.*?)\n*^#/m, 1])
11
+ raise "Failed to extract description from readme"
12
+ end
13
+ desc.gsub(/\n/, ' ').strip
14
+ end
15
+
16
+ Jeweler::Tasks.new do |gem|
17
+ # gem is a Gem::Specification... see
18
+ # http://docs.rubygems.org/read/chapter/20 for more options
19
+ gem.name = 'cute_print'
20
+ gem.homepage = 'http://github.com/wconrad/cute_print'
21
+ gem.license = 'MIT'
22
+ gem.summary = %Q{print debug to stderr, with flair}
23
+ gem.description = description
24
+ gem.email = 'wconrad@yagni.com'
25
+ gem.authors = ['Wayne Conrad']
26
+ # dependencies defined in Gemfile
27
+ end
28
+
29
+ Jeweler::RubygemsDotOrgTasks.new
data/tasks/spec.rake ADDED
@@ -0,0 +1,5 @@
1
+ require 'rspec/core'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new 'test:spec'
5
+ task :spec => ['test:spec']
data/tasks/test.rake ADDED
@@ -0,0 +1,2 @@
1
+ desc "Run all tests"
2
+ task :test => ["test:spec", "test:cucumber"]
data/tasks/yard.rake ADDED
@@ -0,0 +1,3 @@
1
+ require 'yard'
2
+ YARD::Rake::YardocTask.new do |t|
3
+ end
@@ -0,0 +1,16 @@
1
+ require "stringio"
2
+
3
+ module CapturesStderr
4
+
5
+ def capture_stderr
6
+ orig_stderr = $stderr
7
+ $stderr = StringIO.new
8
+ begin
9
+ yield
10
+ $stderr.string
11
+ ensure
12
+ $stderr = orig_stderr
13
+ end
14
+ end
15
+
16
+ end
@@ -0,0 +1,16 @@
1
+ require "stringio"
2
+
3
+ module CapturesStdout
4
+
5
+ def capture_stdout
6
+ orig_stdout = $stdout
7
+ $stdout = StringIO.new
8
+ begin
9
+ yield
10
+ $stdout.string
11
+ ensure
12
+ $stdout = orig_stdout
13
+ end
14
+ end
15
+
16
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cute_print
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Wayne Conrad
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby_parser
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ruby2ruby
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.1'
41
+ description: 'Write debug output to the console, with flair. Features: * Inspects
42
+ its output, like Kernel#p * Writes to $stderr by default (good when $stdout is redirected)
43
+ * Can print the filename and line number * Can print the source of the value * Can
44
+ print a value in the middle of a call chain * Configurable output device This is
45
+ for those who prefer to debug by writing things to the console.'
46
+ email: wconrad@yagni.com
47
+ executables: []
48
+ extensions: []
49
+ extra_rdoc_files:
50
+ - LICENSE
51
+ - README.md
52
+ files:
53
+ - ".config/cucumber.yml"
54
+ - ".rspec"
55
+ - ".yardopts"
56
+ - Gemfile
57
+ - Gemfile.lock
58
+ - LICENSE
59
+ - README.md
60
+ - Rakefile
61
+ - VERSION
62
+ - basic101.gemspec
63
+ - cute_print.gemspec
64
+ - features/.nav
65
+ - features/configuring/configure_output.feature
66
+ - features/configuring/configure_position_format.feature
67
+ - features/configuring/readme.md
68
+ - features/configuring/reset_configuration.feature
69
+ - features/inspect_call_chain.feature
70
+ - features/inspect_objects/inspect.feature
71
+ - features/inspect_objects/label_and_inspect.feature
72
+ - features/inspect_objects/print_source_location.feature
73
+ - features/inspect_objects/readme.md
74
+ - features/readme.md
75
+ - features/support/env.rb
76
+ - features/support/helpers/example.rb
77
+ - features/support/helpers/temp_dir.rb
78
+ - features/support/step_definitions.rb
79
+ - lib/cute_print.rb
80
+ - lib/cute_print/configure.rb
81
+ - lib/cute_print/core_ext.rb
82
+ - lib/cute_print/core_ext/object.rb
83
+ - lib/cute_print/default_printer.rb
84
+ - lib/cute_print/finds_foreign_caller.rb
85
+ - lib/cute_print/mixin.rb
86
+ - lib/cute_print/printer.rb
87
+ - lib/cute_print/ruby_generator.rb
88
+ - lib/cute_print/ruby_parser.rb
89
+ - lib/cute_print/ruby_parser/block.rb
90
+ - lib/cute_print/ruby_parser/method_call.rb
91
+ - lib/cute_print/ruby_parser/parsed_code.rb
92
+ - lib/cute_print/ruby_parser/wraps_sexp.rb
93
+ - lib/cute_print/stderr_out.rb
94
+ - spec/cute_print_spec.rb
95
+ - spec/printer_spec.rb
96
+ - spec/spec_helper.rb
97
+ - spec/support/captures_stderr.rb
98
+ - tasks/cucumber.rake
99
+ - tasks/default.rake
100
+ - tasks/jeweler.rake
101
+ - tasks/spec.rake
102
+ - tasks/test.rake
103
+ - tasks/yard.rake
104
+ - test_support/captures_stderr.rb
105
+ - test_support/captures_stdout.rb
106
+ homepage: http://github.com/wconrad/cute_print
107
+ licenses:
108
+ - MIT
109
+ metadata: {}
110
+ post_install_message:
111
+ rdoc_options: []
112
+ require_paths:
113
+ - lib
114
+ required_ruby_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ required_rubygems_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ requirements: []
125
+ rubyforge_project:
126
+ rubygems_version: 2.2.2
127
+ signing_key:
128
+ specification_version: 4
129
+ summary: print debug to stderr, with flair
130
+ test_files: []