restful_routing 1.0.3 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16ac175dad3e4e2495bb9b2998f008d09609a073
4
- data.tar.gz: ea8cf19ae0b0a5a52663dfbf57bb451b354a614c
3
+ metadata.gz: 256710c34b929359d01528329d46725bdb285f2e
4
+ data.tar.gz: ea014b5b5b9112e85131982153ddde0053195e6b
5
5
  SHA512:
6
- metadata.gz: 8616d8a653edc6f1f94b034a3ae22507aea2ed532533a505f8d107b2fe2cda1dff953bac8cd69cf6bb9281be7596206b23931e58eda18f035a5a49ca2dc77a64
7
- data.tar.gz: '075793f5943289398bd039ad3e403793e016f9c7a6431450ff741f8c786949bb9927dcbc756ee4ccc8a4f8bf83c6dc62b261b8b43eec7b50de9daf21b60494a4'
6
+ metadata.gz: 870047c390d2a73d8cccee29bd0405b2da82f8c9483f21648663e14ef7527ca93efe0f9111ddd15bd33f0194bcbf44188a5806c8e8b535069a6b55ac104e74df
7
+ data.tar.gz: f11bdbd004243007b4c9d4b1d51116103ffad6367cdbbb6241c33645c9f1052471334a575d7c25380aa70d889b33dce7c40a1ca16607022714b119697317fd68
@@ -1,3 +1,3 @@
1
1
  module RestfulRouting
2
- VERSION = "1.0.3"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -1,16 +1,50 @@
1
1
  require "restful_routing/version"
2
2
  require 'listen'
3
+ require 'open3'
3
4
 
4
5
  module RestfulRouting
5
6
  base_path = Dir.pwd
6
7
  listening_to = base_path + '/config'
7
8
 
8
9
  listener = Listen.to(listening_to, only: /routes\.rb$/) do |modified, added, removed|
9
- #run `rails routes` and put the output in a file called
10
- #restful_routing.rb
11
- File.open(base_path + '/restful_routing.rb', 'w') do |f|
12
- f.write `rails routes`
13
- end
10
+ #run `rails routes` and put the output in a file called
11
+ #restful_routing.rb
12
+ funny_messages = [
13
+ "Oh, dear. Naughty, naughty! Rails knows what you typed \nand she doesn't like it...\n\n",
14
+ "Whoops! Ya done something ya should'na. Your routes need fixin'.\n\n",
15
+ "Not that you're a cotton-headed-ninny-muggins, \nbut you gotta fix something to get those routes.\n\n",
16
+ "Ummm...your routes shouldn't look like that.\n\n",
17
+ "Why you gotta be like that, man? Now you've gone an' offended Rails\nwith what you typed.\n\n",
18
+ "Dag, yo. Your routes have seen better days.\n\n"
19
+ ]
20
+
21
+ File.open(base_path + '/restful_routing.rb', 'w+') do |f|
22
+ # stdout, stderr, status, thread = Open3.capture3("rails routes")
23
+ stdin, stdout, stderr, thread = Open3.popen3('rails routes')
24
+
25
+ if thread.value.success?
26
+ f.write stdout.read
27
+ else
28
+ f.write funny_messages.sample # choose a random funny message
29
+
30
+ full_error = stderr.read
31
+ error_array = full_error.split "\n"
32
+
33
+ error_array[0...-4].each do |error|
34
+ # Don't get the lines like '/User/username/...'
35
+ if error[0] == '/'
36
+ # unless they have to do with what in the config folder
37
+ if error.index '/config'
38
+ f.write error + "\n"
39
+ end
40
+ else
41
+ f.write error + "\n"
42
+ end
43
+ end #end error_array.each
44
+ f.write "\nRun `rails routes` in the terminal if you want the full error."
45
+ end #end if else
46
+
47
+ end #end File.open
14
48
  end
15
49
  listener.start # not blocking
16
50
  end
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restful_routing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Casey Stinnett
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-10 00:00:00.000000000 Z
11
+ date: 2017-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,17 +89,9 @@ files:
89
89
  - bin/setup
90
90
  - lib/restful_routing.rb
91
91
  - lib/restful_routing/version.rb
92
- - restful_routing-0.1.0.gem
93
- - restful_routing-0.1.1.gem
94
- - restful_routing-0.1.2.gem
95
- - restful_routing-0.1.3.1.gem
96
- - restful_routing-0.1.3.2.gem
97
- - restful_routing-0.1.3.3.gem
98
- - restful_routing-0.1.3.4.gem
99
- - restful_routing-0.1.3.gem
100
- - restful_routing-1.0.1.gem
101
- - restful_routing-1.0.2.gem
102
- - restful_routing-1.0.gem
92
+ - restful_routing-1.0.3.gem
93
+ - restful_routing-1.1.1.gem
94
+ - restful_routing-1.1.gem
103
95
  - restful_routing.gemspec
104
96
  homepage: https://github.com/casey-stinnett/restful_routing
105
97
  licenses:
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file