backtracker 0.1.0 → 0.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.
Files changed (3) hide show
  1. checksums.yaml +15 -0
  2. data/lib/store_path.rb +14 -4
  3. metadata +4 -6
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzZlNTg2OWFmOTg0NTVlNTg2ZTg1Mzc4ZTc1ZWFjN2E0MWM5MDRmOQ==
5
+ data.tar.gz: !binary |-
6
+ YTIyYzg5YzRlMzYyOGZiNTFmMDIwMThjMTg0ZTcyMDIxNmRmZWNiNQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZWQ4YzE0M2NlNTI0YzliMmI0NzgyZThmNjQzYzdhMzhiNDc0YWNmZTMzMzY3
10
+ Y2QxMDliNWE5YTJhYzJlMDAxYmRkNGNmYzkyNzdlN2I2OTRhNTZjODBlY2Rl
11
+ MTQxODE0MWM2Nzk4Nzk4ZmYxYjgxZDFjOTQyYWFmZjVhMTgwNzg=
12
+ data.tar.gz: !binary |-
13
+ NDBhODVlMTczMzEyNjg4YmI2ZDI5MTNjNGJiNDlmZDg5ZmE0MWY2N2Q0MzE0
14
+ MjJjMmYxOTVkYWE0OTExYjRmMjdkZWJmYjAyY2E5MTY0MzNkYzViYzc2OTcx
15
+ MDU1MWNlODI2NTg3NDZjMmRhYzEwMjg2NDZmYzZhZjdiMDViMTk=
@@ -1,10 +1,14 @@
1
1
  module StorePath
2
2
 
3
- def store_current_path( path = nil )
4
- if path.nil?
5
- session[:previous_path] = request.fullpath
3
+ def store_current_path( args = nil )
4
+ if args.nil?
5
+ set_default
6
6
  else
7
- session[:previous_path] = path
7
+ if args[:path]
8
+ args[:path] = args[:path] + "/" if args[:path][-1] != "/"
9
+ args[:path] = args[:path].insert( 0, "/" ) if args[:path][0] != "/"
10
+ session[:previous_path] = args[:path]
11
+ end
8
12
  end
9
13
  end
10
14
 
@@ -12,4 +16,10 @@ module StorePath
12
16
  redirect_to session[:previous_path]
13
17
  end
14
18
 
19
+ private
20
+
21
+ def set_default
22
+ session[:previous_path] = request.fullpath
23
+ end
24
+
15
25
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backtracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.1.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Alex Pellegrini
@@ -22,26 +21,25 @@ files:
22
21
  homepage: http://rubygems.org/gems/backtracker
23
22
  licenses:
24
23
  - Open Source
24
+ metadata: {}
25
25
  post_install_message:
26
26
  rdoc_options: []
27
27
  require_paths:
28
28
  - lib
29
29
  required_ruby_version: !ruby/object:Gem::Requirement
30
- none: false
31
30
  requirements:
32
31
  - - ! '>='
33
32
  - !ruby/object:Gem::Version
34
33
  version: '0'
35
34
  required_rubygems_version: !ruby/object:Gem::Requirement
36
- none: false
37
35
  requirements:
38
36
  - - ! '>='
39
37
  - !ruby/object:Gem::Version
40
38
  version: '0'
41
39
  requirements: []
42
40
  rubyforge_project:
43
- rubygems_version: 1.8.23
41
+ rubygems_version: 2.0.3
44
42
  signing_key:
45
- specification_version: 3
43
+ specification_version: 4
46
44
  summary: Stores previous url/path
47
45
  test_files: []