git_history_rails 0.1.0 → 0.1.1

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: a2fbba16297c9831d4ff5a6050d6cff17240d81b
4
- data.tar.gz: 133d2999cb50f81cbda508acb0634dfea6743708
3
+ metadata.gz: cad8be2eef6266fd0fb835b43ab913f83c8651d7
4
+ data.tar.gz: f7fed28d513d0f9a590f1d574a572f602d2560ef
5
5
  SHA512:
6
- metadata.gz: 71ba0924fbce02720cac18e4b6b72831f49e77d8d5eb3c993db31b8947ef690c7c91ce6a739839433d4e755395f5e840f04d5c5b3470038045969f5a12ff7c91
7
- data.tar.gz: 232a088e404f346791698d95c3a36f93f0a875a626bbb50978240740aa5eeb1af955ca20a0b767df391c5ea945ac590fabc532620ad225d9bd8a561dd0240b6a
6
+ metadata.gz: 201c68d5d386c55b67e6b6b0e0da887f7483c95fd70e781350b88c6707348a29d41da1eea2235ed3d0d1e6556ea75466d054d940fdcd45505672f175e19ae6f4
7
+ data.tar.gz: b4fd7959d3b2dc4780a614085d2a42b8f76e8a66c6deed4ff0ecefa759371c66bdd6c44e706de65d71943c9d27cb109541f3a741997508b14a1d3c9246c0b335
@@ -1,5 +1,9 @@
1
1
  class GitHistoryRails::ApplicationController < ::ApplicationController
2
2
  def index
3
- render "index"
3
+ begin
4
+ render "index"
5
+ rescue
6
+ render "index", layout: false
7
+ end
4
8
  end
5
9
  end
@@ -1,5 +1,31 @@
1
1
  require "git_history_rails/engine"
2
2
 
3
3
  module GitHistoryRails
4
+ module ApplicationHelper
5
+ def method_missing method, *args, &block
6
+ puts "LOOKING FOR ROUTES #{method}"
7
+ if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
8
+ if main_app.respond_to?(method)
9
+ main_app.send(method, *args)
10
+ else
11
+ super
12
+ end
13
+ else
14
+ super
15
+ end
16
+ end
17
+
18
+ def respond_to?(method)
19
+ if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
20
+ if main_app.respond_to?(method)
21
+ true
22
+ else
23
+ super
24
+ end
25
+ else
26
+ super
27
+ end
28
+ end
29
+ end
4
30
 
5
31
  end
@@ -3,17 +3,44 @@ module GitHistoryRails
3
3
  isolate_namespace GitHistoryRails
4
4
  require "git"
5
5
 
6
- initializer 'git_history_rails.configuration' do |app|
7
- File.open("tmp/test_config","a").puts(app.config.to_s)
8
- if app.config.try(:git_history_rails) && app.config.git_history_rails[:mounted_path]
9
- app.routes.append do
10
- mount GitHistoryRails::Engine => app.config.git_history_rails[:mounted_path]
6
+ module ApplicationHelper
7
+ def method_missing method, *args, &block
8
+ puts "LOOKING FOR ROUTES #{method}"
9
+ if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
10
+ if main_app.respond_to?(method)
11
+ main_app.send(method, *args)
12
+ else
13
+ super
14
+ end
15
+ else
16
+ super
17
+ end
11
18
  end
12
- else
13
- app.routes.append do
14
- mount GitHistoryRails::Engine => "/git_history"
19
+
20
+ def respond_to?(method)
21
+ if method.to_s.end_with?('_path') or method.to_s.end_with?('_url')
22
+ if main_app.respond_to?(method)
23
+ true
24
+ else
25
+ super
26
+ end
27
+ else
28
+ super
15
29
  end
16
30
  end
17
31
  end
32
+
33
+ initializer 'git_history_rails.configuration' do |app|
34
+ if app.config.try(:git_history_rails) && app.config.git_history_rails[:mounted_path]
35
+ app.routes.append do
36
+ mount GitHistoryRails::Engine => app.config.git_history_rails[:mounted_path]
37
+ end
38
+ else
39
+ app.routes.append do
40
+ mount GitHistoryRails::Engine => "/git_history"
41
+ end
42
+ end
43
+ end
44
+
18
45
  end
19
46
  end
@@ -1,3 +1,3 @@
1
1
  module GitHistoryRails
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_history_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Vítek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-01 00:00:00.000000000 Z
11
+ date: 2016-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 4.2.0
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 4.2.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: 4.2.0
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 4.2.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: hamlit
29
35
  requirement: !ruby/object:Gem::Requirement