wtforum 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -23,14 +23,23 @@ Or install it yourself as:
23
23
 
24
24
  WTForum has the following features:
25
25
 
26
- ### CRUD (create, read, update, & delete) user accounts
26
+ ### CRUD user accounts
27
27
 
28
- # modeled after ActiveRecord API
29
- WTForum::User.count
28
+ # Modeled after ActiveRecord API
29
+
30
+ # Create
30
31
  user = WTForum::User.create username: "wtforum_test_user", email: "wtforum_test_user@example.com"
32
+
33
+ # Read
34
+ WTForum::User.count
31
35
  user = WTForum::User.find(user.id)
32
- user = WTForum::User.find_by_username(user.username)
36
+ user = WTForum::User.find_by_username(user.username)
37
+
38
+ # Update
33
39
  user.update_attributes! username: "wtforum_test_user_2", email: "wtforum_test_user_2@example.com"
40
+
41
+ # Destroy
42
+ WTForum::User.destroy(user.id)
34
43
  user.destroy
35
44
 
36
45
  ### Log in your user via their Single Sign On (SSO) API
data/lib/wtforum/user.rb CHANGED
@@ -52,8 +52,8 @@ module WTForum
52
52
  find(user_id).update_attributes!(attributes)
53
53
  end
54
54
 
55
- def self.delete user_id
56
- authorized_agent.get delete_uri(user_id)
55
+ def self.destroy user_id
56
+ authorized_agent.get destroy_uri(user_id)
57
57
  true
58
58
  end
59
59
 
@@ -86,7 +86,7 @@ module WTForum
86
86
  end
87
87
 
88
88
  def destroy
89
- self.class.delete id
89
+ self.class.destroy id
90
90
  end
91
91
 
92
92
  attr_accessor :id, :member, :email
@@ -167,7 +167,7 @@ module WTForum
167
167
  uri
168
168
  end
169
169
 
170
- def self.delete_uri user_id
170
+ def self.destroy_uri user_id
171
171
  uri = WTForum.base_uri
172
172
  uri.path = "/register/delete"
173
173
  uri.query = "mem_userid=#{user_id}"
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module WTForum
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -23,7 +23,7 @@ describe WTForum::User do
23
23
 
24
24
  ensure
25
25
  lambda {
26
- user.destroy
26
+ WTForum::User.destroy(user.id)
27
27
  }.should change(WTForum::User, :count).by(-1)
28
28
  end
29
29
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: wtforum
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Micah Geisel
@@ -155,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ! '>='
157
157
  - !ruby/object:Gem::Version
158
- hash: 4273963902836204732
158
+ hash: 416699042937223265
159
159
  segments:
160
160
  - 0
161
161
  version: '0'
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - ! '>='
166
166
  - !ruby/object:Gem::Version
167
- hash: 4273963902836204732
167
+ hash: 416699042937223265
168
168
  segments:
169
169
  - 0
170
170
  version: '0'