komachi-develop 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9dc1df24b75738d25a6d4a8da9c074ef6f475ab6
4
+ data.tar.gz: 2caace71d26f8f45f2daf557b947edd5953099cf
5
+ SHA512:
6
+ metadata.gz: 7de35335a056c2260eb77cad8e79fc33b40858ab17281313f0960c276ae639a92deda7270e07cce309e5fb89ac10cacabfd70e869aa67fcbae0d7ecd9bc68b9d
7
+ data.tar.gz: f6a69000b372aa808ef79dd7150f8c2a736406a58327e3de00ce9c29808cdf282d3299f75acc6c213ce0986557e15df524e6fcc4bd810ee00ca8a2d13d107e33
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in komachi-develop.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Takumi MIURA
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Komachi::Develop
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'komachi-develop'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install komachi-develop
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/TIPS.md ADDED
@@ -0,0 +1,52 @@
1
+ # Tips
2
+
3
+ ## [Pry](https://github.com/pry/pry)
4
+
5
+ ### `help`
6
+ ### `cd`
7
+ ### `ls`
8
+ ### Special Locals
9
+ - `_`
10
+ - 直前のコメンドの結果
11
+ - `_ex_`
12
+ - 直前の例外
13
+ - `_in_`
14
+ - 入力値
15
+ - 例: `_in_[2]`
16
+ - `_out_`
17
+ - 出力値
18
+ - 例: `_out_[2]`
19
+ - `_dir_`
20
+ - ディレクトリパス
21
+ - `_file_`
22
+ - ファイルパス
23
+
24
+ ### `find-method`
25
+ `find-method index`
26
+
27
+ ### `show-method`
28
+ ### `edit-method`
29
+
30
+ ### `show-models`
31
+ ### `show-routes`
32
+ - `show-routes --grep XXX`
33
+
34
+ ### `show-middlewares`
35
+
36
+ ### `reload!`
37
+
38
+ ### `copy`
39
+ ### `sql`
40
+ ### `caller_method`
41
+ ### `command;`
42
+ - セミコロンを末尾に書くと標準出力に結果が表示されない
43
+
44
+ ### `show-stack`
45
+
46
+ ### `hist`
47
+
48
+ ## ログ
49
+ - `/assets`配下のログが邪魔なので排除
50
+ - `lib/quiet_assets.rb`にて対応
51
+ - `WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true`
52
+ - Webrickのバグらしい。thinにすることで解消
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'komachi-develop/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "komachi-develop"
8
+ gem.version = KomachiDevelop::VERSION
9
+ gem.authors = ["Takumi MIURA"]
10
+ gem.email = ["mitaku1104@gmail.com"]
11
+ gem.description = %q{development Gem set}
12
+ gem.summary = %q{development Gem set}
13
+ gem.homepage = "https://github.com/mitaku/komachi_develop"
14
+
15
+ gem.files = `git ls-files`.split($/)
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
+ gem.add_dependency 'rails', '>= 4.0'
20
+ gem.add_dependency 'pry-rails'
21
+ gem.add_dependency 'pry-stack_explorer'
22
+ gem.add_dependency 'pry-rescue'
23
+ gem.add_dependency 'hirb-unicode'
24
+ gem.add_dependency 'better_errors'
25
+ gem.add_dependency 'binding_of_caller'
26
+ gem.add_dependency 'tapp'
27
+ gem.add_dependency 'awesome_print'
28
+
29
+ # gem.add_dependency 'view_source_map'
30
+ # gem.add_dependency 'annotate'
31
+ # gem.add_dependency 'rails-erd'
32
+ # gem.add_dependency 'letter_opener'
33
+ end
@@ -0,0 +1,12 @@
1
+ require 'komachi-develop/railtie'
2
+ require "komachi-develop/version"
3
+ require 'pry-rails'
4
+ require 'komachi-develop/pry-extension'
5
+ require 'pry-rescue'
6
+ require 'pry-stack_explorer'
7
+ require 'better_errors'
8
+ require 'awesome_print'
9
+ require 'tapp'
10
+
11
+ module KomachiDevelop
12
+ end
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ require 'pry'
5
+
6
+ KomachiDevelop::PryExtension = Pry::CommandSet.new
7
+ command_glob = File.expand_path('../pry-extension/*.rb', __FILE__)
8
+
9
+ Dir[command_glob].each do |command|
10
+ require command
11
+ end
12
+
13
+ Pry.commands.import KomachiDevelop::PryExtension
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ KomachiDevelop::PryExtension.create_command "caller_method" do
5
+ def process
6
+ depth = args.first.to_i || 1
7
+ if /^(.+?):(\d+)(?::in `(.*)')?/ =~ caller(depth+1).first
8
+ file = Regexp.last_match[1]
9
+ line = Regexp.last_match[2].to_i
10
+ method = Regexp.last_match[3]
11
+ puts [file, line, method]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ KomachiDevelop::PryExtension.create_command "copy", "Copy argument to the clip-board" do
5
+ def process
6
+ str = args.join(" ")
7
+ IO.popen('pbcopy', 'w') { |f| f << str.to_s }
8
+ end
9
+ end
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ require 'hirb'
5
+
6
+ Hirb::View.instance_eval do
7
+ def enable_output_method
8
+ @output_method = true
9
+ @old_print = Pry.config.print
10
+ Pry.config.print = proc do |output, value|
11
+ Hirb::View.view_or_page_output(value) || @old_print.call(output, value)
12
+ end
13
+ end
14
+
15
+ def disable_output_method
16
+ Pry.config.print = @old_print
17
+ @output_method = nil
18
+ end
19
+ end
20
+
21
+ Hirb.enable
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ KomachiDevelop::PryExtension.create_command "sql", "Send sql over AR." do
5
+ def process
6
+ query = args.join(" ")
7
+
8
+ if ENV['RAILS_ENV'] || defined?(Rails)
9
+ pp ActiveRecord::Base.connection.select_all(query)
10
+ else
11
+ pp "Pry did not require the environment, try `pconsole`"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ Rails.application.assets.logger = Logger.new('/dev/null')
5
+ Rails::Rack::Logger.class_eval do
6
+ def call_with_quiet_assets(env)
7
+ previous_level = Rails.logger.level
8
+ Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index(Rails.application.config.assets.prefix + "/") == 0
9
+ call_without_quiet_assets(env).tap do
10
+ Rails.logger.level = previous_level
11
+ end
12
+ end
13
+ alias_method_chain :call, :quiet_assets
14
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- coding: utf-8 -*-
3
+
4
+ require 'rails'
5
+
6
+ class KomachiDevelop::Railtie < ::Rails::Railtie
7
+ initializer "komachi_develop_railtie.quiet_assets" do
8
+ require 'komachi-develop/quiet_assets'
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module KomachiDevelop
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: komachi-develop
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Takumi MIURA
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry-stack_explorer
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry-rescue
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
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: hirb-unicode
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
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: better_errors
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
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: binding_of_caller
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
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: tapp
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
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: awesome_print
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description: development Gem set
140
+ email:
141
+ - mitaku1104@gmail.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - .gitignore
147
+ - Gemfile
148
+ - LICENSE.txt
149
+ - README.md
150
+ - Rakefile
151
+ - TIPS.md
152
+ - komachi-develop.gemspec
153
+ - lib/komachi-develop.rb
154
+ - lib/komachi-develop/pry-extension.rb
155
+ - lib/komachi-develop/pry-extension/caller_method.rb
156
+ - lib/komachi-develop/pry-extension/copy.rb
157
+ - lib/komachi-develop/pry-extension/hirb.rb
158
+ - lib/komachi-develop/pry-extension/sql.rb
159
+ - lib/komachi-develop/quiet_assets.rb
160
+ - lib/komachi-develop/railtie.rb
161
+ - lib/komachi-develop/version.rb
162
+ homepage: https://github.com/mitaku/komachi_develop
163
+ licenses: []
164
+ metadata: {}
165
+ post_install_message:
166
+ rdoc_options: []
167
+ require_paths:
168
+ - lib
169
+ required_ruby_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - '>='
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ requirements: []
180
+ rubyforge_project:
181
+ rubygems_version: 2.0.3
182
+ signing_key:
183
+ specification_version: 4
184
+ summary: development Gem set
185
+ test_files: []