beeline 0.0.5 → 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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZWQwMzU4YjllNTQ2MzQ0ZWNhNzUwNWM2MDVmZjI1MDA3NTY0OGJhYw==
5
- data.tar.gz: !binary |-
6
- Njc3YjUzMjc4MzczYzE3NTljMzkzZTM5YWRhMTMxZDA1MWRjMDRhNg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OTRmNzkxZDhkODUzYzc4Mzk2NDk4ZmEyZjMzZDJiMTI3MzRmNzFjMWE2N2M2
10
- NGE0NTYyNzVmMTY4NDAzYTY0NDYwMWU2MjNiNmFmMWZiY2VlN2Q1Mzg2NjIx
11
- NjczMGRjOWViZjViZTYwY2M5ZDI2MmQxYWYzMTI4Mjg1NDk5ZDY=
12
- data.tar.gz: !binary |-
13
- N2NiMGNiYzM3Mzk0OThjODdiNzdjYzJiMTg0MDlmZjU3ZWIwNDhjOTZiOWYz
14
- ODU5OTBmYWEyN2Q1YzdkYTkwZGM1NmU5Y2QyMjUyYmM4NjViY2YyMDJjMjBl
15
- NGU3MzUzMTYwZGExMDEzN2NiNzE0OTFjZGE4NTE2Y2Q5NzcyOTk=
2
+ SHA1:
3
+ metadata.gz: 9110d3e6eb63f6b93e699a6ece8fc9a5e91fd121
4
+ data.tar.gz: 210c79731ba0778f694701b7f725337cdf46ecff
5
+ SHA512:
6
+ metadata.gz: 769d1989a0bb36f3c43812276899a2711e6faaf80fa0a5d4cd2b559024d987910889a6fc636d5cbba019553156951f06f4c4aa94d1125c037db1becaa2c3284f
7
+ data.tar.gz: 93077e11ac8d00a5adf62ebf3936bb2d9f3ca9ac7e79a411217f77b6d1be0495cf074e77e4682e7f2567531121fbba7cdcc9deb971ba9bafee6c0a65d5f1e12e
data/bin/beeline CHANGED
@@ -1,3 +1,25 @@
1
- #!/usr/bin/env bash
2
- ruby ./lib/beeline.rb;
3
- cat tmp/cache/routes_*
1
+ #!/usr/bin/env ruby
2
+ require 'digest/md5'
3
+ file_prefix = 'tmp/cache/routes_'
4
+
5
+ md5 = Digest::MD5::new
6
+ unless File.exist?('config/routes.rb')
7
+ puts "Must be used in a Rails project"
8
+ exit 0
9
+ end
10
+
11
+ new_checksum = md5.update(File.binread('config/routes.rb'))
12
+ old_file = Dir.glob("#{file_prefix}*").first
13
+ old_checksum = (old_file || '').sub(file_prefix, '')
14
+ puts "Old Checksum is:#{old_checksum}"
15
+ puts "New Checksum is:#{new_checksum}"
16
+ unless new_checksum == old_checksum
17
+ File.delete(old_file) if old_file
18
+ puts 'bundle exec rake routes'
19
+ routes = `bundle exec rake routes`
20
+ File.open("#{file_prefix}#{new_checksum}", 'w') { |file| file.write(routes) }
21
+ else
22
+ puts " => Routes Have Not Changed "
23
+ end
24
+ puts '************************'
25
+ puts `cat #{file_prefix}#{new_checksum}`
@@ -1,3 +1,3 @@
1
1
  module Beeline
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
data/lib/beeline.rb CHANGED
@@ -1,30 +1,8 @@
1
1
  require "beeline/version"
2
- require 'digest/md5'
3
2
 
4
3
  module Beeline
5
- file_prefix = 'tmp/cache/routes_'
6
-
7
- md5 = Digest::MD5::new
8
- unless File.exist?('config/routes.rb')
9
- puts "Must be used in a Rails project"
10
- exit 0
11
- end
12
-
13
- puts "... Creating checksums"
14
- new_checksum = md5.update(File.binread('config/routes.rb'))
15
- old_file = Dir.glob("#{file_prefix}*").first
16
- old_checksum = (old_file || '').sub(file_prefix, '')
17
-
18
- puts "Old Checksum is:#{old_checksum}"
19
- puts "New Checksum is:#{new_checksum}"
20
-
21
- unless new_checksum == old_checksum
22
- File.delete(old_file) if old_file
23
- puts 'bundle exec rake routes'
24
- routes = `bundle exec rake routes`
25
- File.open("#{file_prefix}#{new_checksum}", 'w') { |file| file.write(routes) }
26
- else
27
- puts " => Routes Have Not Changed "
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
28
7
  end
29
- puts '************************'
30
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rich Soni