blsm-mp-wx 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,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YTc4MjQwYTUzZjk3ZTNkMjQ5MGMzMGVhZGY1NzJiZDFhNWZjMGNlMg==
5
+ data.tar.gz: !binary |-
6
+ MTY4Zjc4ZjAwMTQ4NWE0ODY2ODQ3ODI4MTMwYzc4NmEzNmVhMmMxNA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ OTM5YWQ5MWEwMDE4MDllZjY0Y2U3YTMyYjllOGE2NWFhZWFhMGY3MGRkMzdk
10
+ NzhlMzNlYjZkMTdjYTMxOWRlM2EwMjdjNmQ1NWY1OWRiYmFjNjY2Y2NjNjI0
11
+ ZDk1NDU0YjVhNGIyNDBiYzk0NzBlYWFmZjZiMzI1ZjQwZWRmZTQ=
12
+ data.tar.gz: !binary |-
13
+ Njk0OWRiMzAxY2E3NWIzOTdkNWE5NGEzNzVhNjFlY2YwYWM3YmYxNDVhOTEy
14
+ YTJjM2Y1YjlkMWQzOGU0YTU1YWU3MDE3NDZkMDEyNmVmZTljMzdjOWQ1Yzhk
15
+ ODJiZjE2MjEyZjAyMDYwNTE0MWNjMTY3ODM2ZTZjYzQ0NDc5ZDU=
@@ -0,0 +1,4 @@
1
+ # coding: utf-8
2
+ module BlsmMpWx
3
+ DB_CONFIG =File.open(Rails.root ? File.join(Rails.root, "config", "database.yml") : './config/database.yml').inject('') { |text, line| text+line }
4
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ module BlsmMpWx
3
+ class VdMpWx < BaseRecord
4
+ self.table_name='vd_mp_wxes'
5
+ validates_uniqueness_of :app_id
6
+
7
+ #判断access_token是否过期了
8
+ def access_token_expired?
9
+ return true unless self.access_token
10
+ return true unless self.access_token_expire
11
+ DateTime.now.to_time > self.access_token_expire.to_time
12
+ end
13
+
14
+ #保存token的有效期
15
+ def save_access_token(access_token, expires_in)
16
+ update_attributes({
17
+ access_token: access_token,
18
+ access_token_expire: Time.at(DateTime.now.to_time.to_i + expires_in.to_i/4)
19
+ })
20
+ end
21
+
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,173 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blsm-mp-wx
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - saxer
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-06-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.9'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.9'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '3.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '3.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mysql2
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.16
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.16
83
+ - !ruby/object:Gem::Dependency
84
+ name: activemodel
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '3.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '3.2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activerecord
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '3.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: '3.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: activesupport
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: '3.2'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '3.2'
125
+ - !ruby/object:Gem::Dependency
126
+ name: faraday
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ~>
130
+ - !ruby/object:Gem::Version
131
+ version: '0.9'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: '0.9'
139
+ description: 包括access_token、js_api_ticket的获取,发送消息,模板消息,生成二维码,获取用户信息等。
140
+ email:
141
+ - 15201280641@qq.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - lib/blsm_mp_wx/db_config.rb
147
+ - lib/blsm_mp_wx/model/vd_mp_wx.rb
148
+ homepage: https://bitbucket.org/liuxi/blsm-mp-wx/
149
+ licenses:
150
+ - MIT
151
+ metadata:
152
+ allowed_push_host: https://rubygems.org
153
+ post_install_message:
154
+ rdoc_options: []
155
+ require_paths:
156
+ - lib
157
+ required_ruby_version: !ruby/object:Gem::Requirement
158
+ requirements:
159
+ - - ! '>='
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
162
+ required_rubygems_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ requirements: []
168
+ rubyforge_project:
169
+ rubygems_version: 2.4.6
170
+ signing_key:
171
+ specification_version: 4
172
+ summary: 首趣微店微信公众号基本模块
173
+ test_files: []