syndi 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -6
- data/CHANGELOG.md +9 -0
- data/README.md +16 -74
- data/bin/syndi +8 -13
- data/bin/synditool +18 -0
- data/ext/csyndi/logger.c +40 -10
- data/include/syndi/logger.h +9 -7
- data/lib/csyndi.so +0 -0
- data/lib/syndi.rb +17 -17
- data/lib/syndi/cli.rb +22 -0
- data/lib/syndi/ruby_version_check.rb +15 -0
- data/lib/syndi/rubyext/string.rb +12 -0
- data/lib/syndi/version.rb +5 -10
- data/spec/helper.rb +2 -0
- data/spec/logs/20130209.log +4 -0
- data/tasks/release.rake +115 -0
- metadata +65 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
5
|
-
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1399bb8c7780581c5e1cfb04e07eabde29daafc8
|
4
|
+
data.tar.gz: b5aef319c65fa7d087f8b455fd0299968d4f4a2c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 39ff3929b6a902f9ee8c7a3dfd08f180f5e34d2ed4350506819a32706ca26f59b1dc6be06ad6b2b57e220b0f014978d9f7035f9675ca7daffeb3853227f8b821
|
7
|
+
data.tar.gz: 33d3d8523115ce2678fc28961cf2487a9c9a40154e66cf245d1b1d36e5b10e2870ab4917621c6d42332ea5e2fb95fe5d92a052b8c2d2fe0bd34d241f1b542147
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,67 +1,30 @@
|
|
1
1
|
Syndi
|
2
2
|
=====
|
3
3
|
|
4
|
-
_A modern, elegant, extensible multi-protocol chat bot—reloaded._
|
5
|
-
|
6
|
-
**Formerly known as Auto.**
|
7
|
-
|
8
|
-
**Version**: 0.1.1 "Phoenix"
|
9
|
-
[![Build Status](https://travis-ci.org/syndibot/syndi.png?branch=master)](https://travis-ci.org/syndibot/syndi)
|
10
|
-
[![Dependency Status](https://gemnasium.com/syndibot/syndi.png)](https://gemnasium.com/syndibot/syndi)
|
11
4
|
[![Code Climate](https://codeclimate.com/github/syndibot/syndi.png)](https://codeclimate.com/github/syndibot/syndi)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/syndi.png)](http://badge.fury.io/rb/syndi)
|
6
|
+
[![Build Status](https://travis-ci.org/syndibot/syndi.png?branch=master)](https://travis-ci.org/syndibot/syndi)
|
7
|
+
[![Dependency Status](https://gemnasium.com/syndibot/syndi.png)](https://gemnasium.com/syndibot/syndi)
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
| | |
|
10
|
+
| --------------:|:------------------------------------------ |
|
11
|
+
| **Name:** | Syndi |
|
12
|
+
| **Version:** | 0.1.2 "Phoenix" |
|
13
|
+
| **Summary:** | A modern, elegant, modular chat bot. |
|
14
|
+
| **Author:** | [Autumn Perrault](http://destellae.net/) |
|
15
|
+
| **Homepage:** | [http://syndibot.com](http://syndibot.com) |
|
16
|
+
| **Languages:** | Ruby, C |
|
18
17
|
|
18
|
+
* [Wiki](https://github.com/syndibot/syndi/wiki)
|
19
|
+
* [Mailing List](https://groups.google.com/group/syndibot)
|
20
|
+
* [Issue Tracker](https://github.com/syndibot/syndi/issues)
|
19
21
|
|
20
22
|
Our official IRC channel is [#syndi on irc.freenode.net](irc://irc.freenode.net/#syndi).
|
21
23
|
|
22
|
-
Synopsis
|
23
|
-
--------
|
24
|
-
|
25
|
-
Syndi is automated chat bot software, developed per this philosophy:
|
26
|
-
|
27
|
-
* _Friendly_ to users, and to developers.
|
28
|
-
* _Simple_, _smart_, and _clean_.
|
29
|
-
* _Minimal_ but _extensible_.
|
30
|
-
|
31
|
-
It is a reboot of Auto, an old IRC bot which, though featureful, suffered of design flaws.
|
32
|
-
|
33
|
-
### Is it Production-Ready™?
|
34
|
-
|
35
|
-
Not yet. Syndi's a fairly sizable project. We're getting close though.
|
36
|
-
|
37
24
|
Installation
|
38
25
|
------------
|
39
26
|
|
40
|
-
Please read the [Syndi Handbook](
|
41
|
-
|
42
|
-
**Compiling from source:**
|
43
|
-
|
44
|
-
```shell
|
45
|
-
$ git clone git://github.com/syndibot/syndi.git syndi
|
46
|
-
$ cd syndi/
|
47
|
-
```
|
48
|
-
Use a [specific version](https://github.com/syndibot/syndi/tags):
|
49
|
-
|
50
|
-
```shell
|
51
|
-
$ git checkout v4.0.0.alpha.1
|
52
|
-
```
|
53
|
-
|
54
|
-
Or the cutting-edge HEAD:
|
55
|
-
|
56
|
-
```shell
|
57
|
-
$ git checkout master
|
58
|
-
```
|
59
|
-
|
60
|
-
```shell
|
61
|
-
$ bundle install
|
62
|
-
$ rake
|
63
|
-
$ rake install
|
64
|
-
```
|
27
|
+
Please read the [Syndi Handbook](http://syndibot.com/handbook/).
|
65
28
|
|
66
29
|
Syndi is currently known to function on these operating systems:
|
67
30
|
|
@@ -74,31 +37,10 @@ Using these Ruby virtual machines:
|
|
74
37
|
|
75
38
|
+ MRI/YARV (official) 2.0.0
|
76
39
|
|
77
|
-
Support
|
78
|
-
-------
|
79
|
-
|
80
|
-
If you should find yourself in need of support, please foremost consult with the
|
81
|
-
documentation on the [wiki](https://github.com/syndibot/syndi/wiki).
|
82
|
-
|
83
|
-
If the wiki fails to address your needs, please either:
|
84
|
-
|
85
|
-
1. Post to the [syndibot](https://groups.google.com/group/syndibot)
|
86
|
-
group under the _support_ category, **or**
|
87
|
-
2. Join the official IRC chatroom at
|
88
|
-
[#syndi on irc.freenode.net](http://webchat.freenode.net/?randomnick=1&channels=#syndi&prompt=1)
|
89
|
-
|
90
|
-
**Bugs** should be reported on the [issue management hub](https://github.com/syndibot/syndi/issues).
|
91
|
-
|
92
|
-
Authors
|
93
|
-
-------
|
94
|
-
|
95
|
-
Syndi 4 was rewritten from scratch by Autumn Perrault (noxgirl) in Ruby and C,
|
96
|
-
and is actively developed by the core team.
|
97
|
-
|
98
40
|
Legal
|
99
41
|
-----
|
100
42
|
|
101
43
|
Copyright (c) 2009-2013, Autumn Perrault. All rights reserved.
|
102
44
|
|
103
45
|
Syndi is free, open-source software, distributed per the terms of the two-clause
|
104
|
-
("FreeBSD") license, the full terms of which are in [**LICENSE**](LICENSE).
|
46
|
+
("FreeBSD") BSD license, the full terms of which are in [**LICENSE**](LICENSE).
|
data/bin/syndi
CHANGED
@@ -5,12 +5,6 @@
|
|
5
5
|
require 'English'
|
6
6
|
require 'rbconfig'
|
7
7
|
|
8
|
-
# Perform a check of the Ruby version.
|
9
|
-
if ::RbConfig::CONFIG['ruby_version'] < '2.0.0'
|
10
|
-
puts 'Syndi requires Ruby v2.0.0 or later. Please read the Syndi Handbook.'
|
11
|
-
exit 1
|
12
|
-
end
|
13
|
-
|
14
8
|
# Forbid root.
|
15
9
|
if ENV.include? 'USER'
|
16
10
|
if ENV['USER'] == 'root'
|
@@ -19,21 +13,22 @@ if ENV.include? 'USER'
|
|
19
13
|
end
|
20
14
|
end
|
21
15
|
|
22
|
-
# Import necessary libraries.
|
23
|
-
require 'slop'
|
24
16
|
# Import system Syndi libraries, or fall back to internal ones.
|
25
17
|
begin
|
26
|
-
require 'syndi'
|
18
|
+
require 'syndi/ruby_version_check'
|
27
19
|
rescue LoadError
|
28
20
|
$LOAD_PATH.unshift File.join(__dir__, '..', 'lib')
|
29
|
-
require 'syndi'
|
21
|
+
require 'syndi/ruby_version_check'
|
30
22
|
end
|
23
|
+
|
24
|
+
# Import necessary libraries.
|
25
|
+
require 'slop'
|
26
|
+
require 'syndi'
|
31
27
|
require 'syndi/verbosity'
|
32
28
|
|
33
29
|
# Change to the Syndi directory.
|
34
|
-
|
35
|
-
|
36
|
-
Dir.chdir SYNDI_DIR
|
30
|
+
Syndi.dir = File.join ENV['HOME'], '.syndi'
|
31
|
+
Syndi.celluloid_log
|
37
32
|
|
38
33
|
$VERBOSITY = 0
|
39
34
|
|
data/bin/synditool
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Copyright (c) 2013, Autumn Perrault, et al. All rights reserved.
|
3
|
+
# This free software is distributed under the FreeBSD license (see LICENSE).
|
4
|
+
|
5
|
+
require 'English'
|
6
|
+
|
7
|
+
# Import the system libraries, or fall back to internal distribution.
|
8
|
+
begin
|
9
|
+
require 'syndi/cli'
|
10
|
+
rescue LoadError
|
11
|
+
$LOAD_PATH.unshift File.join(__dir__, '..', 'lib')
|
12
|
+
require 'syndi/cli'
|
13
|
+
end
|
14
|
+
|
15
|
+
# Start the CLI.
|
16
|
+
Syndi::CLI.start ARGV
|
17
|
+
|
18
|
+
# vim: set ts=4 sts=2 sw=2 et:
|
data/ext/csyndi/logger.c
CHANGED
@@ -104,19 +104,19 @@ static void log_dircheck()
|
|
104
104
|
*
|
105
105
|
* @return [Syndi::Logger]
|
106
106
|
*/
|
107
|
-
VALUE logger_init(VALUE self)
|
107
|
+
static VALUE logger_init(VALUE self)
|
108
108
|
{
|
109
109
|
log_dircheck();
|
110
110
|
return self;
|
111
111
|
}
|
112
112
|
|
113
113
|
/* @overload fatal(message)
|
114
|
-
* This will log
|
114
|
+
* This will log `message` as a fatal error, as well as kill the program.
|
115
115
|
*
|
116
116
|
* @param [String] message The fatal error message to be reported.
|
117
117
|
* @return [nil]
|
118
118
|
*/
|
119
|
-
VALUE logger_fatal(VALUE self, VALUE message)
|
119
|
+
static VALUE logger_fatal(VALUE self, VALUE message)
|
120
120
|
{
|
121
121
|
char *msg = RSTRING_PTR(message);
|
122
122
|
log_out2file("FATAL ERROR", msg);
|
@@ -126,14 +126,14 @@ VALUE logger_fatal(VALUE self, VALUE message)
|
|
126
126
|
}
|
127
127
|
|
128
128
|
/* @overload error(message)
|
129
|
-
* This will log
|
129
|
+
* This will log `message` as an error, optionally also outputting `backtrace`,
|
130
130
|
* the data for which shall be obtained from Kernel#caller.
|
131
131
|
*
|
132
132
|
* @param [String] message The error message to be reported.
|
133
133
|
* @param [Boolean] backtrace Whether to output a backtrace.
|
134
134
|
* @return [nil]
|
135
135
|
*/
|
136
|
-
VALUE logger_error(int argc, VALUE *argv, VALUE self)
|
136
|
+
static VALUE logger_error(int argc, VALUE *argv, VALUE self)
|
137
137
|
{
|
138
138
|
VALUE message;
|
139
139
|
VALUE backtrace;
|
@@ -157,12 +157,12 @@ VALUE logger_error(int argc, VALUE *argv, VALUE self)
|
|
157
157
|
}
|
158
158
|
|
159
159
|
/* @overload warn(message)
|
160
|
-
* This will log
|
160
|
+
* This will log `message` as a warning.
|
161
161
|
*
|
162
162
|
* @param [String] message The admonitory message to be reported.
|
163
163
|
* @return [nil]
|
164
164
|
*/
|
165
|
-
VALUE logger_warn(VALUE self, VALUE message)
|
165
|
+
static VALUE logger_warn(VALUE self, VALUE message)
|
166
166
|
{
|
167
167
|
char *msg = RSTRING_PTR(message);
|
168
168
|
log_out2file("WARNING", msg);
|
@@ -170,13 +170,36 @@ VALUE logger_warn(VALUE self, VALUE message)
|
|
170
170
|
return Qnil;
|
171
171
|
}
|
172
172
|
|
173
|
+
/* @overload deprecate(message)
|
174
|
+
* This will call Kernel#warn with the notice of deprecation.
|
175
|
+
*
|
176
|
+
* @param [String] message The notice regarding usage of a deprecated method.
|
177
|
+
* @return [nil]
|
178
|
+
*/
|
179
|
+
static VALUE logger_deprecate(VALUE self, VALUE message)
|
180
|
+
{
|
181
|
+
VALUE backtrace;
|
182
|
+
VALUE notice;
|
183
|
+
|
184
|
+
notice = rb_str_new("DEPRECATION WARNING: ", 21);
|
185
|
+
rb_str_append(notice, message);
|
186
|
+
|
187
|
+
rb_funcall(rb_cObject, SYM(warn), 1, notice);
|
188
|
+
|
189
|
+
backtrace = rb_funcall(rb_cObject, SYM(caller), 0);
|
190
|
+
fprintf(stderr, "Backtrace:%s", OS_LINE_TERM);
|
191
|
+
rb_funcall(rb_stderr, SYM(puts), 1, backtrace);
|
192
|
+
|
193
|
+
return Qnil;
|
194
|
+
}
|
195
|
+
|
173
196
|
/* @overload info(message)
|
174
|
-
* This will log
|
197
|
+
* This will log `message` as an informative message.
|
175
198
|
*
|
176
199
|
* @param [String] message The information to be reported.
|
177
200
|
* @return [nil]
|
178
201
|
*/
|
179
|
-
VALUE logger_info(VALUE self, VALUE message)
|
202
|
+
static VALUE logger_info(VALUE self, VALUE message)
|
180
203
|
{
|
181
204
|
char *msg = RSTRING_PTR(message);
|
182
205
|
log_out2file("INFO", msg);
|
@@ -194,7 +217,7 @@ VALUE logger_info(VALUE self, VALUE message)
|
|
194
217
|
*
|
195
218
|
* @return [nil]
|
196
219
|
*/
|
197
|
-
VALUE logger_verbose(VALUE self, VALUE message, VALUE level)
|
220
|
+
static VALUE logger_verbose(VALUE self, VALUE message, VALUE level)
|
198
221
|
{
|
199
222
|
char *msg = RSTRING_PTR(message);
|
200
223
|
int vrb = FIX2INT(level);
|
@@ -214,6 +237,11 @@ VALUE logger_verbose(VALUE self, VALUE message, VALUE level)
|
|
214
237
|
return Qnil;
|
215
238
|
}
|
216
239
|
|
240
|
+
static VALUE logger_debug(VALUE self, VALUE message)
|
241
|
+
{
|
242
|
+
return logger_verbose(self, message, INT2FIX(3));
|
243
|
+
}
|
244
|
+
|
217
245
|
/* initializes Syndi::Logger in Ruby */
|
218
246
|
void init_syndi_logger()
|
219
247
|
{
|
@@ -222,7 +250,9 @@ void init_syndi_logger()
|
|
222
250
|
rb_define_method(cLogger, "fatal", logger_fatal, 1);
|
223
251
|
rb_define_method(cLogger, "error", logger_error, -1);
|
224
252
|
rb_define_method(cLogger, "verbose", logger_verbose, 2);
|
253
|
+
rb_define_method(cLogger, "debug", logger_debug, 1);
|
225
254
|
rb_define_method(cLogger, "warn", logger_warn, 1);
|
255
|
+
rb_define_method(cLogger, "deprecate", logger_deprecate, 1);
|
226
256
|
rb_define_method(cLogger, "info", logger_info, 1);
|
227
257
|
}
|
228
258
|
|
data/include/syndi/logger.h
CHANGED
@@ -33,13 +33,15 @@ extern VALUE cLogger;
|
|
33
33
|
void init_syndi_logger();
|
34
34
|
|
35
35
|
/* Ruby-accessible methods */
|
36
|
-
VALUE logger_init(VALUE self);
|
37
|
-
|
38
|
-
VALUE logger_fatal(VALUE self, VALUE message);
|
39
|
-
VALUE logger_error(int argc, VALUE *argv, VALUE message);
|
40
|
-
VALUE logger_verbose(VALUE self, VALUE message, VALUE level);
|
41
|
-
VALUE logger_warning(VALUE self, VALUE message);
|
42
|
-
VALUE
|
36
|
+
static VALUE logger_init(VALUE self);
|
37
|
+
|
38
|
+
static VALUE logger_fatal(VALUE self, VALUE message);
|
39
|
+
static VALUE logger_error(int argc, VALUE *argv, VALUE message);
|
40
|
+
static VALUE logger_verbose(VALUE self, VALUE message, VALUE level);
|
41
|
+
static VALUE logger_warning(VALUE self, VALUE message);
|
42
|
+
static VALUE logger_debug(VALUE self, VALUE message);
|
43
|
+
static VALUE logger_deprecate(VALUE self, VALUE message);
|
44
|
+
static VALUE logger_info(VALUE self, VALUE message);
|
43
45
|
|
44
46
|
/* internal functions */
|
45
47
|
static void log_out2scrn(int type, const char *message, int level);
|
data/lib/csyndi.so
CHANGED
Binary file
|
data/lib/syndi.rb
CHANGED
@@ -5,6 +5,8 @@ require 'syndi/rubyext/string'
|
|
5
5
|
require 'syndi/version'
|
6
6
|
require 'fileutils'
|
7
7
|
|
8
|
+
require 'term/ansicolor'
|
9
|
+
|
8
10
|
module Syndi
|
9
11
|
extend self
|
10
12
|
|
@@ -38,17 +40,14 @@ module Syndi
|
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
41
|
-
#
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
String.send
|
49
|
-
end
|
50
|
-
extras.each do |extr|
|
51
|
-
String.send(:define_method, extr, proc { self })
|
43
|
+
# Install terminal colors.
|
44
|
+
def colorize
|
45
|
+
if windows?
|
46
|
+
Term::ANSIColor.attributes.each do |name|
|
47
|
+
String.send :define_method, name, proc { self }
|
48
|
+
end
|
49
|
+
else
|
50
|
+
String.send :include, Term::ANSIColor
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
@@ -84,6 +83,11 @@ module Syndi
|
|
84
83
|
@logger ||= Syndi::Logger.new
|
85
84
|
end
|
86
85
|
|
86
|
+
# Make Celluloid logging consistent with Syndi logging.
|
87
|
+
def celluloid_log
|
88
|
+
Celluloid.logger = self.log
|
89
|
+
end
|
90
|
+
|
87
91
|
# Central event system access.
|
88
92
|
#
|
89
93
|
# @return [Syndi::Events]
|
@@ -125,13 +129,9 @@ module Syndi
|
|
125
129
|
|
126
130
|
end
|
127
131
|
|
128
|
-
if Syndi.windows?
|
129
|
-
Syndi.windows_colored
|
130
|
-
else
|
131
|
-
require 'colored'
|
132
|
-
end
|
133
|
-
|
134
132
|
require 'csyndi'
|
135
133
|
%w[events actress config bot].each { |lib| require "syndi/#{lib}" }
|
136
134
|
|
135
|
+
Syndi.colorize
|
136
|
+
|
137
137
|
# vim: set ts=4 sts=2 sw=2 et:
|
data/lib/syndi/cli.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Copyright (c) 2013, Autumn Perrault, et al. All rights reserved.
|
2
|
+
# This free software is distributed under the FreeBSD license (see LICENSE).
|
3
|
+
|
4
|
+
require 'thor'
|
5
|
+
|
6
|
+
require 'syndi/config/generator'
|
7
|
+
|
8
|
+
module Syndi
|
9
|
+
|
10
|
+
# The central command-line interface class which underlies synditool.
|
11
|
+
class CLI
|
12
|
+
|
13
|
+
desc 'genconf', 'Start the interactive configuration generator.'
|
14
|
+
def confgen
|
15
|
+
Syndi::Config::Generator.start
|
16
|
+
end
|
17
|
+
|
18
|
+
end # class CLI
|
19
|
+
|
20
|
+
end # module Syndi
|
21
|
+
|
22
|
+
# vim: set ts=4 sts=2 sw=2 et:
|
@@ -0,0 +1,15 @@
|
|
1
|
+
if RUBY_VERSION < '2.0.0'
|
2
|
+
desc = defined?(RUBY_DESCRIPTION) ? RUBY_DESCRIPTION : "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE})"
|
3
|
+
|
4
|
+
abort <<-message
|
5
|
+
|
6
|
+
Syndi requires Ruby 2.0.0+.
|
7
|
+
|
8
|
+
You're running
|
9
|
+
#{desc}
|
10
|
+
|
11
|
+
Please upgrade Ruby to proceed. For information on this, see the Syndi Handbook:
|
12
|
+
http://syndibot.com/handbook/
|
13
|
+
|
14
|
+
message
|
15
|
+
end
|
data/lib/syndi/rubyext/string.rb
CHANGED
@@ -5,6 +5,18 @@ class String
|
|
5
5
|
alias_method :dc, :downcase
|
6
6
|
alias_method :uc!, :upcase!
|
7
7
|
alias_method :dc!, :downcase!
|
8
|
+
|
9
|
+
# Somewhat imperfect camelization (from snake-case strings).
|
10
|
+
def camelize
|
11
|
+
if self !~ /_/
|
12
|
+
capitalize
|
13
|
+
else
|
14
|
+
words = split /_/
|
15
|
+
words.map! { |word| word.capitalize }
|
16
|
+
words.join
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
8
20
|
end
|
9
21
|
|
10
22
|
# vim: set ts=4 sts=2 sw=2 et:
|
data/lib/syndi/version.rb
CHANGED
@@ -6,21 +6,16 @@ module Syndi
|
|
6
6
|
# Standard version string.
|
7
7
|
#
|
8
8
|
# We use semantic versioning: +MAJOR.MINOR.PATCH.PRE.PRENUM+
|
9
|
-
VERSION
|
9
|
+
VERSION = '0.1.2'.freeze
|
10
10
|
|
11
11
|
# Standard version plus the codename (assigned to each minor release).
|
12
12
|
#
|
13
13
|
# i.e., +VERSION-CODENAME+
|
14
14
|
FULLVERSION = "#{VERSION}-phoenix".freeze
|
15
15
|
|
16
|
-
# @return [Boolean] Whether this is
|
17
|
-
def self.
|
18
|
-
(VERSION =~ /alpha/).nil? ? false : true
|
19
|
-
end
|
20
|
-
|
21
|
-
# @return [Boolean] Whether this is a beta-stage copy.
|
22
|
-
def self.beta?
|
23
|
-
(VERSION =~ /beta/).nil? ? false : true
|
16
|
+
# @return [Boolean] Whether this is a prerelease copy.
|
17
|
+
def self.prerelease?
|
18
|
+
(VERSION =~ /alpha|beta|pre/).nil? ? false : true
|
24
19
|
end
|
25
20
|
|
26
21
|
# @return [Boolean] Whether this is a release candidate copy.
|
@@ -30,7 +25,7 @@ module Syndi
|
|
30
25
|
|
31
26
|
# @return [Boolean] Whether this is an edge (i.e. testing, development, unstable) copy.
|
32
27
|
def self.edge?
|
33
|
-
|
28
|
+
prerelease? || rc? || VERSION < '1'
|
34
29
|
end
|
35
30
|
|
36
31
|
end
|
data/spec/helper.rb
CHANGED
@@ -16,6 +16,7 @@ require 'syndi'
|
|
16
16
|
$temp_dir = Dir.mktmpdir
|
17
17
|
Syndi.dir = $temp_dir
|
18
18
|
$VERBOSITY = -1
|
19
|
+
Syndi.celluloid_log
|
19
20
|
|
20
21
|
module Helper
|
21
22
|
|
@@ -27,6 +28,7 @@ RSpec.configure do |conf|
|
|
27
28
|
conf.after(:all) do
|
28
29
|
Dir.chdir __dir__
|
29
30
|
FileUtils.remove_entry $temp_dir
|
31
|
+
Syndi.dir = __dir__
|
30
32
|
end
|
31
33
|
|
32
34
|
conf.expect_with :rspec do |c|
|
data/tasks/release.rake
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
# Copyright (c) 2013, Autumn Perrault, et al. All rights reserved.
|
2
|
+
# This free software is distributed under the FreeBSD license (see LICENSE).
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
require 'tmpdir'
|
6
|
+
require 'psych'
|
7
|
+
|
8
|
+
desc 'Task for release automation.'
|
9
|
+
task :release, [:version] => [:compile, :spec] do |t, args|
|
10
|
+
version = args[:version]
|
11
|
+
|
12
|
+
## Adjust the version numbers.
|
13
|
+
data = ''
|
14
|
+
|
15
|
+
# lib/syndi/version.rb
|
16
|
+
File.open(File.join(__dir__, '..', 'lib', 'syndi', 'version.rb')) { |f| data = f.read }
|
17
|
+
data.sub! /VERSION = '(.+?)'\.freeze/, "VERSION = '#{version}'.freeze"
|
18
|
+
File.open(File.join(__dir__, '..', 'lib', 'syndi', 'version.rb'), 'w') { |f| f.write data }
|
19
|
+
|
20
|
+
# README.md
|
21
|
+
File.open(File.join(__dir__, '..', 'README.md')) { |f| data = f.read }
|
22
|
+
data.sub! /\| \*\*Version:\*\* \| (.+?)\s"([\w\s]+)"\s+\|/ do |string|
|
23
|
+
codename = $2
|
24
|
+
new = "#{version} \"#{codename}\"".ljust 42
|
25
|
+
"| **Version:** | #{new} |"
|
26
|
+
end
|
27
|
+
File.open(File.join(__dir__, '..', 'README.md'), 'w') { |f| f.write data }
|
28
|
+
|
29
|
+
# CHANGELOG.md
|
30
|
+
File.open(File.join(__dir__, '..', 'CHANGELOG.md')) { |f| data = f.read }
|
31
|
+
data.sub! /unreleased\n----------/ do |string|
|
32
|
+
line = '-'
|
33
|
+
version.length.times { line << '-' }
|
34
|
+
"v#{version}\n#{line}"
|
35
|
+
end
|
36
|
+
File.open(File.join(__dir__, '..', 'CHANGELOG.md'), 'w') { |f| f.write data }
|
37
|
+
|
38
|
+
# with that mess out of the way, let's do the git stuff
|
39
|
+
Dir.chdir File.join(__dir__, '..')
|
40
|
+
|
41
|
+
`git commit -a -m "Syndi v#{version}"`
|
42
|
+
`git tag -a v#{version} -m "Syndi v#{version}"`
|
43
|
+
`git push`
|
44
|
+
`git push --tags`
|
45
|
+
|
46
|
+
# now package the gem
|
47
|
+
perform :clean
|
48
|
+
FileUtils.remove_entry File.join(__dir__, '..', 'pkg')
|
49
|
+
|
50
|
+
perform :gem # first the Ruby gem
|
51
|
+
|
52
|
+
# then the Windows gem
|
53
|
+
perform :clean
|
54
|
+
`rake cross compile native gem`
|
55
|
+
|
56
|
+
### NOTE: this is just for me because you can't push gems from prerelease
|
57
|
+
### rubygems, so remove this after 2.0 is released as stable
|
58
|
+
### --Autumn
|
59
|
+
`rbenv global system`
|
60
|
+
|
61
|
+
# push the gems
|
62
|
+
Dir['pkg/syndi-*.gem'].each do |gem|
|
63
|
+
`gem push #{File.expand_path gem}`
|
64
|
+
end
|
65
|
+
|
66
|
+
# see note above
|
67
|
+
`rbenv global 2.0.0-rc2`
|
68
|
+
|
69
|
+
# clean up
|
70
|
+
perform :clean
|
71
|
+
FileUtils.remove_entry File.join(__dir__, '..', 'pkg')
|
72
|
+
|
73
|
+
## now we need to make a blog post ##
|
74
|
+
temp = Dir.mktmpdir
|
75
|
+
Dir.chdir temp
|
76
|
+
|
77
|
+
`git clone git@github.com:syndibot/syndibot.github.com.git blog`
|
78
|
+
Dir.chdir 'blog'
|
79
|
+
|
80
|
+
data = ''
|
81
|
+
File.open('_config.yml') { |f| data = f.read }
|
82
|
+
info = Psych.load data
|
83
|
+
info['versions'].unshift version
|
84
|
+
|
85
|
+
if version < '1'
|
86
|
+
info['latest'] = version
|
87
|
+
info['latest_pre'] = version
|
88
|
+
else
|
89
|
+
if version =~ /alpha|beta|pre|rc/
|
90
|
+
info['latest_pre'] = version
|
91
|
+
else
|
92
|
+
info['latest'] = version
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
File.open('_config.yml', 'w') { |f| f.write info.to_yaml }
|
97
|
+
`./manage post --category=releases --title="v#{version} released"`
|
98
|
+
|
99
|
+
Dir.chdir __dir__
|
100
|
+
FileUtils.remove_entry temp
|
101
|
+
|
102
|
+
puts <<-message
|
103
|
+
|
104
|
+
Release finished! Syndi #{version} is now available for download.
|
105
|
+
|
106
|
+
If there was need for a codename change, you ought to have already done that.
|
107
|
+
|
108
|
+
In any event, you should probably now notify the mailing list with the link above. (:
|
109
|
+
https://groups.google.com/group/syndibot
|
110
|
+
|
111
|
+
message
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
# vim: set ts=4 sts=2 sw=2 et:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syndi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Autumn Perrault
|
@@ -9,132 +9,160 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: archive-tar-minitar
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0.5'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0.5'
|
14
28
|
- !ruby/object:Gem::Dependency
|
15
29
|
name: bundler
|
16
30
|
requirement: !ruby/object:Gem::Requirement
|
17
31
|
requirements:
|
18
|
-
- -
|
32
|
+
- - '>='
|
19
33
|
- !ruby/object:Gem::Version
|
20
34
|
version: '1.2'
|
21
35
|
type: :runtime
|
22
36
|
prerelease: false
|
23
37
|
version_requirements: !ruby/object:Gem::Requirement
|
24
38
|
requirements:
|
25
|
-
- -
|
39
|
+
- - '>='
|
26
40
|
- !ruby/object:Gem::Version
|
27
41
|
version: '1.2'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: celluloid
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
31
45
|
requirements:
|
32
|
-
- -
|
46
|
+
- - ~>
|
33
47
|
- !ruby/object:Gem::Version
|
34
48
|
version: '0.12'
|
35
49
|
type: :runtime
|
36
50
|
prerelease: false
|
37
51
|
version_requirements: !ruby/object:Gem::Requirement
|
38
52
|
requirements:
|
39
|
-
- -
|
53
|
+
- - ~>
|
40
54
|
- !ruby/object:Gem::Version
|
41
55
|
version: '0.12'
|
42
56
|
- !ruby/object:Gem::Dependency
|
43
57
|
name: celluloid-io
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
|
-
- -
|
60
|
+
- - ~>
|
47
61
|
- !ruby/object:Gem::Version
|
48
62
|
version: '0.12'
|
49
63
|
type: :runtime
|
50
64
|
prerelease: false
|
51
65
|
version_requirements: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
|
-
- -
|
67
|
+
- - ~>
|
54
68
|
- !ruby/object:Gem::Version
|
55
69
|
version: '0.12'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
71
|
+
name: term-ansicolor
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
59
73
|
requirements:
|
60
|
-
- -
|
74
|
+
- - '>='
|
61
75
|
- !ruby/object:Gem::Version
|
62
|
-
version: '1.
|
76
|
+
version: '1.0'
|
63
77
|
type: :runtime
|
64
78
|
prerelease: false
|
65
79
|
version_requirements: !ruby/object:Gem::Requirement
|
66
80
|
requirements:
|
67
|
-
- -
|
81
|
+
- - '>='
|
68
82
|
- !ruby/object:Gem::Version
|
69
|
-
version: '1.
|
83
|
+
version: '1.0'
|
70
84
|
- !ruby/object:Gem::Dependency
|
71
85
|
name: redis
|
72
86
|
requirement: !ruby/object:Gem::Requirement
|
73
87
|
requirements:
|
74
|
-
- -
|
88
|
+
- - ~>
|
75
89
|
- !ruby/object:Gem::Version
|
76
90
|
version: '3.0'
|
77
91
|
type: :runtime
|
78
92
|
prerelease: false
|
79
93
|
version_requirements: !ruby/object:Gem::Requirement
|
80
94
|
requirements:
|
81
|
-
- -
|
95
|
+
- - ~>
|
82
96
|
- !ruby/object:Gem::Version
|
83
97
|
version: '3.0'
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: slop
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
87
101
|
requirements:
|
88
|
-
- -
|
102
|
+
- - ~>
|
89
103
|
- !ruby/object:Gem::Version
|
90
104
|
version: '3.4'
|
91
105
|
type: :runtime
|
92
106
|
prerelease: false
|
93
107
|
version_requirements: !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
|
-
- -
|
109
|
+
- - ~>
|
96
110
|
- !ruby/object:Gem::Version
|
97
111
|
version: '3.4'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: thor
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ~>
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0.17'
|
119
|
+
type: :runtime
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0.17'
|
98
126
|
- !ruby/object:Gem::Dependency
|
99
127
|
name: rake
|
100
128
|
requirement: !ruby/object:Gem::Requirement
|
101
129
|
requirements:
|
102
|
-
- -
|
130
|
+
- - '>='
|
103
131
|
- !ruby/object:Gem::Version
|
104
132
|
version: '0'
|
105
133
|
type: :development
|
106
134
|
prerelease: false
|
107
135
|
version_requirements: !ruby/object:Gem::Requirement
|
108
136
|
requirements:
|
109
|
-
- -
|
137
|
+
- - '>='
|
110
138
|
- !ruby/object:Gem::Version
|
111
139
|
version: '0'
|
112
140
|
- !ruby/object:Gem::Dependency
|
113
141
|
name: rake-compiler
|
114
142
|
requirement: !ruby/object:Gem::Requirement
|
115
143
|
requirements:
|
116
|
-
- -
|
144
|
+
- - '>='
|
117
145
|
- !ruby/object:Gem::Version
|
118
146
|
version: '0'
|
119
147
|
type: :development
|
120
148
|
prerelease: false
|
121
149
|
version_requirements: !ruby/object:Gem::Requirement
|
122
150
|
requirements:
|
123
|
-
- -
|
151
|
+
- - '>='
|
124
152
|
- !ruby/object:Gem::Version
|
125
153
|
version: '0'
|
126
154
|
- !ruby/object:Gem::Dependency
|
127
155
|
name: rspec
|
128
156
|
requirement: !ruby/object:Gem::Requirement
|
129
157
|
requirements:
|
130
|
-
- -
|
158
|
+
- - '>='
|
131
159
|
- !ruby/object:Gem::Version
|
132
160
|
version: '0'
|
133
161
|
type: :development
|
134
162
|
prerelease: false
|
135
163
|
version_requirements: !ruby/object:Gem::Requirement
|
136
164
|
requirements:
|
137
|
-
- -
|
165
|
+
- - '>='
|
138
166
|
- !ruby/object:Gem::Version
|
139
167
|
version: '0'
|
140
168
|
description: |2
|
@@ -150,11 +178,14 @@ extra_rdoc_files: []
|
|
150
178
|
files:
|
151
179
|
- bin/syndi-conf
|
152
180
|
- bin/syndi
|
181
|
+
- bin/synditool
|
153
182
|
- lib/csyndi.so
|
154
183
|
- lib/syndi/dsl/irc.rb
|
155
184
|
- lib/syndi/dsl/base.rb
|
185
|
+
- lib/syndi/ruby_version_check.rb
|
156
186
|
- lib/syndi/verbosity.rb
|
157
187
|
- lib/syndi/api.rb
|
188
|
+
- lib/syndi/cli.rb
|
158
189
|
- lib/syndi/rubyext/string.rb
|
159
190
|
- lib/syndi/irc.rb
|
160
191
|
- lib/syndi/api/object.rb
|
@@ -198,6 +229,7 @@ files:
|
|
198
229
|
- include/syndi/events.h
|
199
230
|
- include/syndi.h
|
200
231
|
- tasks/spec.rake
|
232
|
+
- tasks/release.rake
|
201
233
|
- tasks/compile.rake
|
202
234
|
- tasks/package.rake
|
203
235
|
- tasks/install.rake
|
@@ -207,41 +239,40 @@ files:
|
|
207
239
|
- CHANGELOG.md
|
208
240
|
- Gemfile
|
209
241
|
- Rakefile
|
210
|
-
-
|
242
|
+
- .yardopts
|
211
243
|
- conf/example.yml
|
212
244
|
- spec/helper.rb
|
213
245
|
- spec/syndi/events_spec.rb
|
246
|
+
- spec/logs/20130209.log
|
214
247
|
homepage: http://syndibot.com
|
215
248
|
licenses:
|
216
249
|
- FreeBSD
|
217
250
|
metadata: {}
|
218
|
-
post_install_message:
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
https://github.com/syndibot/syndi/wiki/Handbook
|
223
|
-
|
224
|
-
Moreover, you should typically now run `syndi-conf` to produce a configuration file.
|
251
|
+
post_install_message: "Thanks for choosing Syndi to serve your chat bot needs! (:\n\nWe
|
252
|
+
suggest that, if you're not already consulting it, you read the Syndi Handbook:\nhttps://github.com/syndibot/syndi/wiki/Handbook\n\nMoreover,
|
253
|
+
you should typically now run `synditool genconf` to produce a configuration file.\n\r\nNOTICE:
|
254
|
+
You have installed the binary distribution of this gem."
|
225
255
|
rdoc_options: []
|
226
256
|
require_paths:
|
227
257
|
- lib
|
228
258
|
required_ruby_version: !ruby/object:Gem::Requirement
|
229
259
|
requirements:
|
230
|
-
- -
|
260
|
+
- - '>='
|
231
261
|
- !ruby/object:Gem::Version
|
232
262
|
version: '0'
|
233
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
264
|
requirements:
|
235
|
-
- -
|
265
|
+
- - '>='
|
236
266
|
- !ruby/object:Gem::Version
|
237
267
|
version: '0'
|
238
268
|
requirements: []
|
239
269
|
rubyforge_project:
|
240
|
-
rubygems_version: 2.0.0.rc.
|
270
|
+
rubygems_version: 2.0.0.rc.2
|
241
271
|
signing_key:
|
242
272
|
specification_version: 4
|
243
273
|
summary: A modern, elegant, extensible multi-protocol bot.
|
244
274
|
test_files:
|
245
275
|
- spec/helper.rb
|
246
276
|
- spec/syndi/events_spec.rb
|
277
|
+
- spec/logs/20130209.log
|
247
278
|
- Rakefile
|