ss_manager 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a004427df871dd9940fd617c8d1f3b05a2e36a07
4
+ data.tar.gz: 22b9828eaa7d9d626a612e848cf2d56b4278bd58
5
+ SHA512:
6
+ metadata.gz: 05e96fd24d5730c64eca77525e0c85db8a9af58f0c74d590300b88b12efa7df2e1a9f10cfd1959e89b097c12f0d7ae6cb1b8c360273159434cc703950487192d
7
+ data.tar.gz: 702db049c8497f300120b3c67e9d56badd0a8234bf4fb1b3a73515596680a4f84acb0aae424467eff9a92541cc4653125b9b7c742ed5ce33ab1a630da205599d
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 «fearlessstar»
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # SsManager
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ss_manager`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'ss_manager'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install ss_manager
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ss_manager.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,2 @@
1
+ class Session < ApplicationRecord
2
+ end
@@ -0,0 +1,3 @@
1
+ if ActiveRecord::Migrator.get_all_versions.any?
2
+ Session.destroy_all if ActiveRecord::Base.connection.table_exists? 'sessions'
3
+ end
@@ -0,0 +1,12 @@
1
+ class SessionManager
2
+
3
+ def set_session session
4
+ @session = session
5
+ end
6
+ # for example of usability | как пример использования
7
+ def uid
8
+ @session[:uid]
9
+ end
10
+ end
11
+
12
+ $ss_manager = SessionManager.new
@@ -0,0 +1,27 @@
1
+ module SSManager
2
+ require 'thor'
3
+ require 'thor/group'
4
+
5
+ class InstallGenerator < Rails::Generators::Base
6
+ include Thor::Actions
7
+
8
+ def self.source_root
9
+ File.dirname(__FILE__) + '../../project'
10
+ end
11
+
12
+ def create_initializers
13
+
14
+ initializers = ['config/initializers/session_destroyer.rb', 'config/initializers/session_manager.rb']
15
+
16
+ initializers.each do |path|
17
+ copy_file path, path unless File.exists? path
18
+ end
19
+
20
+ end
21
+
22
+ def add_model
23
+ copy_file 'app/models/session.rb', 'app/models/session.rb'
24
+ end
25
+
26
+ end
27
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ss_manager
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nikolay Martynov AKA Fearlessstar
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activerecord-session_store
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
+ description: "session manager for object-oriented manage session and destroy sessions
56
+ by session destroyer on server start\n recommend use with
57
+ gem 'activerecord-session_store'\n такой менеджер сессии
58
+ - удобная штука на мой взгляд, если нужно много где инициализировать абстрактные
59
+ материалы хранимые в сесии и всё такое, то объектно-ориентированный подход как нельзя
60
+ кстати, к тому же это элегантно.\n привет выживающим в
61
+ россии, от выживающего в москве\n "
62
+ email:
63
+ - shadows.of.unevenness@gmail.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - LICENSE.txt
69
+ - README.md
70
+ - Rakefile
71
+ - lib/generators/project/app/models/session.rb
72
+ - lib/generators/project/config/initializers/session_destroyer.rb
73
+ - lib/generators/project/config/initializers/session_manager.rb
74
+ - lib/generators/s_s_manager/install_generator.rb
75
+ homepage: https://github.com/fearlessstar/ss_manager
76
+ licenses:
77
+ - MIT
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: 2.3.1
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.6.6
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: session manager and destroy sessions on server start этот менеджер сессии
99
+ - удобная штука, удаление сессий при старте сервера в подарок'
100
+ test_files: []