del 0.1.13 → 0.1.14

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
  SHA256:
3
- metadata.gz: 1e542987e7160cf15180f8f407bfcca487a6ac838dd49053d7e0873cdb9957c9
4
- data.tar.gz: 56a74a9ace41f411dd97e67542f632e4b7977c0216fe3fd0e83a6e5860d24bc6
3
+ metadata.gz: e85d9b9946bae3f1de83c5b5aa9ca4233f857f709442a1b936db6ec844966407
4
+ data.tar.gz: de3491021d7b76d98f1ac3c589333a13853ac11175ce64c08ff1172421b3656f
5
5
  SHA512:
6
- metadata.gz: fb0e5d947858eeb50f953e6220238dadcb84f86e7840e50b37ef612aba1442f9d441baabbd11a17cb55be4777227db5dd37956107ea85f8374d26e7163c4c603
7
- data.tar.gz: efe75336361cbd007fcc14b348040bb213b4419bbc66dbbca1de090bdaf5f2018b59dffa3ea3ec01b96d7a83e2177f14c92f6c7b89d4f124b340f294019d3038
6
+ metadata.gz: 56f686105ffd29d6e69948cc0c0788ce57c86d562a2433457b41df1562145c8db58becbbabb6c84b9abfa4e3b80c36bd7c222d78f176655d3937317f354240fe
7
+ data.tar.gz: 7f5bbcccc027f0a5ada5d7802fe4b2c69aa8991f8a830299687f3477a10b4c29be59f1f705a0dc0e644a23a781e285b5a1576912ed5c14eb80025d69cd27d3e2
data/README.md CHANGED
@@ -20,18 +20,9 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- Create a `.delrc` file in your `$HOME` directory.
23
+ Run the setup command.
24
24
 
25
- Add the following environment variables:
26
-
27
- ```text
28
- DEL_FULL_NAME='Del the Funky Robosapien'
29
- DEL_HOST='chat.mycompany.com'
30
- DEL_JID='my_id@chat.btf.hipchat.com'
31
- DEL_MUC_DOMAIN='conf.btf.hipchat.com'
32
- DEL_PASSWORD=secret
33
- DEL_ROOMS=1_pidge,2_hunk,3_shiro
34
- ```
25
+ $ del setup
35
26
 
36
27
  Start the chat server:
37
28
 
data/lib/del/cli.rb CHANGED
@@ -7,7 +7,7 @@ module Del
7
7
  DEFAULT_RC=Pathname.new(Dir.home).join(".delrc")
8
8
  class_option :configuration_file, default: ENV.fetch("DELRC", DEFAULT_RC)
9
9
  class_option :socket_file, default: Del::Configuration::SOCKET_FILE
10
- class_option :log_level, default: Logger::INFO
10
+ class_option :log_level, default: ENV.fetch("LOG_LEVEL", Logger::INFO).to_i
11
11
 
12
12
  desc "server <routes.rb>", "start server"
13
13
  def server(startup_file = nil)
@@ -19,7 +19,7 @@ module Del
19
19
  client.auth(configuration.password)
20
20
  roster = Jabber::Roster::Helper.new(client, false)
21
21
  roster.add_update_callback do |old_item, item|
22
- users.upsert(item['jid'], User.new(item['jid'], item)) if item
22
+ users.upsert(item['jid'], item.attributes) if item
23
23
  end
24
24
  roster.get_roster
25
25
  roster.wait_for_roster
@@ -10,11 +10,7 @@ module Del
10
10
  end
11
11
 
12
12
  def find_by(id)
13
- @lock.synchronize { @storage[id.to_s] }
14
- end
15
-
16
- def find_by_value
17
- @lock.synchronize { @storage.values.find { |x| yield x } }
13
+ @lock.synchronize { Del::User.new(id, @storage[id.to_s]) }
18
14
  end
19
15
 
20
16
  def find_all
data/lib/del/source.rb CHANGED
@@ -8,7 +8,7 @@ module Del
8
8
  end
9
9
 
10
10
  def from?(robot)
11
- user.attributes.jid == robot.jid.to_s
11
+ user.jid == robot.jid.to_s
12
12
  end
13
13
 
14
14
  def reply(robot, message)
data/lib/del/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Del
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: del
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-09 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xmpp4r