movabletype 0.1.0 → 0.2.0

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.
@@ -12,6 +12,7 @@ module MovableType
12
12
  :text_more => 'mt_text_more',
13
13
  :excerpt => 'mt_excerpt',
14
14
  :keywords => 'mt_keywords',
15
+ :tags => 'mt_tags',
15
16
  :trackbacks => 'mt_tb_ping_urls'
16
17
  }
17
18
  Struct2Option = Method2Struct.invert
@@ -43,7 +44,7 @@ module MovableType
43
44
  :convert
44
45
  when nil
45
46
  else
46
- if name == :keywords
47
+ if name == :keywords or name == :tags
47
48
  res.split ','
48
49
  else
49
50
  res
@@ -86,7 +87,7 @@ module MovableType
86
87
 
87
88
  attr_reader :title,:description
88
89
  attr_accessor :id
89
- option_get :date,:break,:text_more,:excerpt,:keywords,:trackbacks
90
+ option_get :date,:break,:text_more,:excerpt,:keywords,:trackbacks,:tags
90
91
  option_is :comment,:trackback
91
92
  def initialize(title,description,option={:date=>Time.now})
92
93
  @title = title
@@ -123,7 +124,7 @@ module MovableType
123
124
  hash[field] = 'convert_breaks'
124
125
  when nil
125
126
  else
126
- if method == :keywords
127
+ if method == :keywords or method == :tags
127
128
  hash[field] = res.join(',')
128
129
  else
129
130
  hash[field] = res
data/test/test_post.rb CHANGED
@@ -41,6 +41,18 @@ class PostTest < Test::Unit::TestCase
41
41
  @klass.push MovableType::Post.new('hoge','baz',
42
42
  {:date=>@now,:text_more=>'more'})
43
43
 
44
+ @struct.push({'title'=>'hoge',
45
+ 'description'=>'baz',
46
+ 'dateCreated'=>@now,
47
+ 'mt_tags'=>'a,b,c'})
48
+ @method.push({:title=>'hoge',
49
+ :description=>'baz',
50
+ :date=>@now,
51
+ :tags => ['a','b','c'],
52
+ :id=>nil})
53
+ @klass.push MovableType::Post.new('hoge','baz',
54
+ {:date=>@now,:tags=>['a','b','c']})
55
+
44
56
  @struct.push({'title'=>'hoge',
45
57
  'description'=>'baz',
46
58
  'dateCreated'=>@now,
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: movabletype
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2006-08-14 00:00:00 +09:00
6
+ version: 0.2.0
7
+ date: 2006-08-15 00:00:00 +09:00
8
8
  summary: MovableType API for Ruby
9
9
  require_paths:
10
10
  - lib