gdocs_features 0.1.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.
Files changed (43) hide show
  1. data/README +0 -0
  2. data/Rakefile +35 -0
  3. data/VERSION +1 -0
  4. data/bin/remotefeatures +7 -0
  5. data/cucumber.yml +2 -0
  6. data/features/patch_local_files_from_gdocs.feature +33 -0
  7. data/features/step_definitions/diff_steps.rb +19 -0
  8. data/features/step_definitions/google_steps.rb +19 -0
  9. data/features/step_definitions/local_steps.rb +16 -0
  10. data/features/support/env.rb +5 -0
  11. data/gdocs_features.gemspec +97 -0
  12. data/lib/difference.rb +31 -0
  13. data/lib/feature.rb +26 -0
  14. data/lib/feature_diff.rb +46 -0
  15. data/lib/file_feature.rb +37 -0
  16. data/lib/file_feature_store.rb +17 -0
  17. data/lib/google_authorization.rb +18 -0
  18. data/lib/google_docs_client.rb +20 -0
  19. data/lib/google_feature.rb +51 -0
  20. data/lib/google_feature_store.rb +44 -0
  21. data/lib/google_resource.rb +11 -0
  22. data/lib/remote_features/cli/main.rb +30 -0
  23. data/lib/remote_features/dialogue.rb +25 -0
  24. data/pkg/gdocs_features-0.1.0.gem +0 -0
  25. data/spec/cli_spec.rb +69 -0
  26. data/spec/dialogue_spec.rb +69 -0
  27. data/spec/feature_diff_spec.rb +80 -0
  28. data/spec/feature_reformat_spec.rb +40 -0
  29. data/spec/file_feature_spec.rb +23 -0
  30. data/spec/file_feature_store_spec.rb +33 -0
  31. data/spec/google_authorization_spec.rb +26 -0
  32. data/spec/google_docs_client_spec.rb +32 -0
  33. data/spec/google_feature_spec.rb +46 -0
  34. data/spec/google_feature_store_spec.rb +64 -0
  35. data/spec/google_resource_spec.rb +25 -0
  36. data/spec/integration_spec.rb +42 -0
  37. data/spec/spec_helper.rb +5 -0
  38. data/spec/stubs/documents.atom.xml +36 -0
  39. data/spec/stubs/example.feature +16 -0
  40. data/spec/stubs/folders.atom.xml +69 -0
  41. data/spec/temp_file_system.rb +19 -0
  42. data/spec/temp_file_system_spec.rb +28 -0
  43. metadata +117 -0
@@ -0,0 +1,69 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005">
3
+ <id>http://docs.google.com/feeds/documents/private/full</id>
4
+ <updated>2009-02-22T16:16:09.850Z</updated>
5
+ <title type="text">Available Documents - restapitest@googlemail.com</title>
6
+ <link rel="alternate" type="text/html" href="http://docs.google.com"/>
7
+ <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full"/>
8
+ <link rel="http://schemas.google.com/g/2005#post" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full"/>
9
+ <link rel="self" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/-/folder?showfolders=true"/>
10
+ <author>
11
+ <name>restapitest</name>
12
+ <email>restapitest@googlemail.com</email>
13
+ </author>
14
+ <openSearch:totalResults>3</openSearch:totalResults>
15
+ <openSearch:startIndex>1</openSearch:startIndex>
16
+ <entry>
17
+ <id>http://docs.google.com/feeds/documents/private/full/folder%3A245d04a6-bbb4-4cc4-9740-a1657f4251fb</id>
18
+ <published>0001-01-03T00:00:00.000Z</published>
19
+ <updated>2009-02-21T09:27:48.857Z</updated>
20
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#folder" label="folder"/>
21
+ <title type="text">fruit</title>
22
+ <content type="application/atom+xml" src="http://docs.google.com/feeds/folders/private/full/folder%3A245d04a6-bbb4-4cc4-9740-a1657f4251fb"/>
23
+ <link rel="alternate" type="text/html" href="http://docs.google.com/#folders/folder.0.245d04a6-bbb4-4cc4-9740-a1657f4251fb"/>
24
+ <link rel="self" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3A245d04a6-bbb4-4cc4-9740-a1657f4251fb"/>
25
+ <link rel="edit" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3A245d04a6-bbb4-4cc4-9740-a1657f4251fb/frg38ad5"/>
26
+ <author>
27
+ <name>restapitest</name>
28
+ <email>restapitest@googlemail.com</email>
29
+ </author>
30
+ <gd:feedLink rel="http://schemas.google.com/acl/2007#accessControlList" href="http://docs.google.com/feeds/acl/private/full/folder%3A245d04a6-bbb4-4cc4-9740-a1657f4251fb"/>
31
+ </entry>
32
+ <entry>
33
+ <id>http://docs.google.com/feeds/documents/private/full/folder%3A3d2e0e26-0a8b-49b9-994b-f1cf19a4da1e</id>
34
+ <published>0001-01-03T00:00:00.000Z</published>
35
+ <updated>2009-02-21T09:27:48.593Z</updated>
36
+ <category scheme="http://schemas.google.com/docs/2007/folders/restapitest@googlemail.com" term="fruit" label="fruit"/>
37
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#folder" label="folder"/>
38
+ <title type="text">green</title>
39
+ <content type="application/atom+xml" src="http://docs.google.com/feeds/folders/private/full/folder%3A3d2e0e26-0a8b-49b9-994b-f1cf19a4da1e"/>
40
+ <link rel="http://schemas.google.com/docs/2007#parent" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3A245d04a6-bbb4-4cc4-9740-a1657f4251fb" title="fruit"/>
41
+ <link rel="alternate" type="text/html" href="http://docs.google.com/#folders/folder.0.3d2e0e26-0a8b-49b9-994b-f1cf19a4da1e"/>
42
+ <link rel="self" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3A3d2e0e26-0a8b-49b9-994b-f1cf19a4da1e"/>
43
+ <link rel="edit" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3A3d2e0e26-0a8b-49b9-994b-f1cf19a4da1e/frg38a5t"/>
44
+ <author>
45
+ <name>restapitest</name>
46
+ <email>restapitest@googlemail.com</email>
47
+ </author>
48
+ <gd:feedLink rel="http://schemas.google.com/acl/2007#accessControlList" href="http://docs.google.com/feeds/acl/private/full/folder%3A3d2e0e26-0a8b-49b9-994b-f1cf19a4da1e"/>
49
+ </entry>
50
+ <entry>
51
+ <id>http://docs.google.com/feeds/documents/private/full/folder%3Aa58446b0-772d-4ff7-bcb5-eb280b0cf53a</id>
52
+ <published>0001-01-03T00:00:00.000Z</published>
53
+ <updated>2009-02-20T00:13:22.305Z</updated>
54
+ <category scheme="http://schemas.google.com/docs/2007/folders/restapitest@googlemail.com" term="fruit" label="fruit"/>
55
+ <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#folder" label="folder"/>
56
+ <title type="text">yellow</title>
57
+ <content type="application/atom+xml" src="http://docs.google.com/feeds/folders/private/full/folder%3Aa58446b0-772d-4ff7-bcb5-eb280b0cf53a"/>
58
+ <link rel="http://schemas.google.com/docs/2007#parent" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3A245d04a6-bbb4-4cc4-9740-a1657f4251fb" title="fruit"/>
59
+ <link rel="alternate" type="text/html" href="http://docs.google.com/#folders/folder.0.a58446b0-772d-4ff7-bcb5-eb280b0cf53a"/>
60
+ <link rel="self" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3Aa58446b0-772d-4ff7-bcb5-eb280b0cf53a"/>
61
+ <link rel="edit" type="application/atom+xml" href="http://docs.google.com/feeds/documents/private/full/folder%3Aa58446b0-772d-4ff7-bcb5-eb280b0cf53a/fre3zf29"/>
62
+ <author>
63
+ <name>restapitest</name>
64
+ <email>restapitest@googlemail.com</email>
65
+ </author>
66
+ <gd:feedLink rel="http://schemas.google.com/acl/2007#accessControlList" href="http://docs.google.com/feeds/acl/private/full/folder%3Aa58446b0-772d-4ff7-bcb5-eb280b0cf53a"/>
67
+ </entry>
68
+ </feed>
69
+
@@ -0,0 +1,19 @@
1
+ require 'tmpdir'
2
+ require 'fileutils'
3
+
4
+ class TempFileSystem
5
+ attr_reader :root
6
+
7
+ def initialize(hash)
8
+ @root = File.join(Dir.tmpdir, Time.now.to_f.to_s)
9
+ hash.each do |path,contents|
10
+ full_path = File.expand_path(File.join(@root, path))
11
+ FileUtils.mkdir_p(File.dirname(full_path))
12
+ File.open(full_path, 'w') {|f| f.write(contents) }
13
+ end
14
+ end
15
+
16
+ def destroy
17
+ FileUtils.rm_rf @root
18
+ end
19
+ end
@@ -0,0 +1,28 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+ require File.dirname(__FILE__) + '/temp_file_system'
3
+
4
+ describe TempFileSystem do
5
+ before do
6
+ @fs = TempFileSystem.new(
7
+ 'fish/happy/salmon.txt' => 'Hi there',
8
+ 'fish/sad/trout' => 'Goodbye'
9
+ )
10
+ end
11
+
12
+ after do
13
+ @fs.destroy
14
+ end
15
+
16
+ it "should create text files as specified in a hash of path => content" do
17
+ File.readlines(File.join(@fs.root, 'fish/happy/salmon.txt')).should == ['Hi there']
18
+ File.readlines(File.join(@fs.root, 'fish/sad/trout')).should == ['Goodbye']
19
+ end
20
+
21
+ it "should destroy everything under the root" do
22
+ File.exist?(File.join(@fs.root, 'fish/happy/salmon.txt')).should == true
23
+ File.exist?(File.join(@fs.root, 'fish/sad/trout')).should == true
24
+ @fs.destroy
25
+ File.exist?(File.join(@fs.root, 'fish/happy/salmon.txt')).should == false
26
+ File.exist?(File.join(@fs.root, 'fish/sad/trout')).should == false
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gdocs_features
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Josh Chisholm
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-02-22 00:00:00 -08:00
18
+ default_executable: remotefeatures
19
+ dependencies: []
20
+
21
+ description: Cucumber features merged locally from Google Docs
22
+ email: jody@alkema.ca
23
+ executables:
24
+ - remotefeatures
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - README
29
+ files:
30
+ - README
31
+ - Rakefile
32
+ - VERSION
33
+ - bin/remotefeatures
34
+ - cucumber.yml
35
+ - features/patch_local_files_from_gdocs.feature
36
+ - features/step_definitions/diff_steps.rb
37
+ - features/step_definitions/google_steps.rb
38
+ - features/step_definitions/local_steps.rb
39
+ - features/support/env.rb
40
+ - gdocs_features.gemspec
41
+ - lib/difference.rb
42
+ - lib/feature.rb
43
+ - lib/feature_diff.rb
44
+ - lib/file_feature.rb
45
+ - lib/file_feature_store.rb
46
+ - lib/google_authorization.rb
47
+ - lib/google_docs_client.rb
48
+ - lib/google_feature.rb
49
+ - lib/google_feature_store.rb
50
+ - lib/google_resource.rb
51
+ - lib/remote_features/cli/main.rb
52
+ - lib/remote_features/dialogue.rb
53
+ - pkg/gdocs_features-0.1.0.gem
54
+ - spec/cli_spec.rb
55
+ - spec/dialogue_spec.rb
56
+ - spec/feature_diff_spec.rb
57
+ - spec/feature_reformat_spec.rb
58
+ - spec/file_feature_spec.rb
59
+ - spec/file_feature_store_spec.rb
60
+ - spec/google_authorization_spec.rb
61
+ - spec/google_docs_client_spec.rb
62
+ - spec/google_feature_spec.rb
63
+ - spec/google_feature_store_spec.rb
64
+ - spec/google_resource_spec.rb
65
+ - spec/integration_spec.rb
66
+ - spec/spec_helper.rb
67
+ - spec/stubs/documents.atom.xml
68
+ - spec/stubs/example.feature
69
+ - spec/stubs/folders.atom.xml
70
+ - spec/temp_file_system.rb
71
+ - spec/temp_file_system_spec.rb
72
+ has_rdoc: true
73
+ homepage: http://github.com/alkema/gdocs-features
74
+ licenses: []
75
+
76
+ post_install_message:
77
+ rdoc_options:
78
+ - --charset=UTF-8
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ requirements: []
96
+
97
+ rubyforge_project:
98
+ rubygems_version: 1.3.6
99
+ signing_key:
100
+ specification_version: 3
101
+ summary: Cucumber features in gdocs
102
+ test_files:
103
+ - spec/cli_spec.rb
104
+ - spec/dialogue_spec.rb
105
+ - spec/feature_diff_spec.rb
106
+ - spec/feature_reformat_spec.rb
107
+ - spec/file_feature_spec.rb
108
+ - spec/file_feature_store_spec.rb
109
+ - spec/google_authorization_spec.rb
110
+ - spec/google_docs_client_spec.rb
111
+ - spec/google_feature_spec.rb
112
+ - spec/google_feature_store_spec.rb
113
+ - spec/google_resource_spec.rb
114
+ - spec/integration_spec.rb
115
+ - spec/spec_helper.rb
116
+ - spec/temp_file_system.rb
117
+ - spec/temp_file_system_spec.rb