nokogiri-happymapper 0.8.1 → 0.10.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +1 -4
- data/lib/happymapper/anonymous_mapper.rb +6 -5
- data/lib/happymapper/class_methods.rb +466 -0
- data/lib/happymapper/element.rb +3 -3
- data/lib/happymapper/item.rb +19 -13
- data/lib/happymapper/supported_types.rb +4 -6
- data/lib/happymapper/syntax_error.rb +6 -0
- data/lib/happymapper/version.rb +1 -1
- data/lib/happymapper.rb +54 -505
- data/lib/nokogiri-happymapper.rb +1 -1
- metadata +100 -107
- data/spec/features/after_parse_callbacks_spec.rb +0 -32
- data/spec/features/attribute_default_value_spec.rb +0 -48
- data/spec/features/attributes_spec.rb +0 -35
- data/spec/features/has_many_empty_array_spec.rb +0 -44
- data/spec/features/ignay_spec.rb +0 -92
- data/spec/features/inheritance_spec.rb +0 -121
- data/spec/features/mixed_namespaces_spec.rb +0 -60
- data/spec/features/parse_with_object_to_update_spec.rb +0 -116
- data/spec/features/same_tag_different_meaning_spec.rb +0 -44
- data/spec/features/to_xml_spec.rb +0 -205
- data/spec/features/to_xml_with_namespaces_spec.rb +0 -237
- data/spec/features/wildcard_tag_name_spec.rb +0 -110
- data/spec/features/wrap_spec.rb +0 -87
- data/spec/features/xpath_spec.rb +0 -84
- data/spec/fixtures/address.xml +0 -9
- data/spec/fixtures/ambigous_items.xml +0 -22
- data/spec/fixtures/analytics.xml +0 -61
- data/spec/fixtures/analytics_profile.xml +0 -127
- data/spec/fixtures/atom.xml +0 -19
- data/spec/fixtures/commit.xml +0 -52
- data/spec/fixtures/current_weather.xml +0 -89
- data/spec/fixtures/current_weather_missing_elements.xml +0 -18
- data/spec/fixtures/default_namespace_combi.xml +0 -6
- data/spec/fixtures/dictionary.xml +0 -20
- data/spec/fixtures/family_tree.xml +0 -21
- data/spec/fixtures/inagy.xml +0 -85
- data/spec/fixtures/lastfm.xml +0 -355
- data/spec/fixtures/multiple_namespaces.xml +0 -170
- data/spec/fixtures/multiple_primitives.xml +0 -5
- data/spec/fixtures/optional_attributes.xml +0 -6
- data/spec/fixtures/pita.xml +0 -133
- data/spec/fixtures/posts.xml +0 -23
- data/spec/fixtures/product_default_namespace.xml +0 -18
- data/spec/fixtures/product_no_namespace.xml +0 -10
- data/spec/fixtures/product_single_namespace.xml +0 -10
- data/spec/fixtures/quarters.xml +0 -19
- data/spec/fixtures/radar.xml +0 -21
- data/spec/fixtures/set_config_options.xml +0 -3
- data/spec/fixtures/statuses.xml +0 -422
- data/spec/fixtures/subclass_namespace.xml +0 -50
- data/spec/fixtures/unformatted_address.xml +0 -1
- data/spec/fixtures/wrapper.xml +0 -11
- data/spec/happymapper/anonymous_mapper_spec.rb +0 -158
- data/spec/happymapper/attribute_spec.rb +0 -12
- data/spec/happymapper/item_spec.rb +0 -177
- data/spec/happymapper_spec.rb +0 -1208
- data/spec/spec_helper.rb +0 -25
@@ -1,110 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe 'Wildcard Root Tag', type: :feature do
|
6
|
-
generic_class_xml = %(
|
7
|
-
<root>
|
8
|
-
<description>some description</description>
|
9
|
-
<blarg name='blargname1' href='http://blarg.com'/>
|
10
|
-
<blarg name='blargname2' href='http://blarg.com'/>
|
11
|
-
<jello name='jelloname' href='http://jello.com'/>
|
12
|
-
<subelement>
|
13
|
-
<jello name='subjelloname' href='http://ohnojello.com' other='othertext'/>
|
14
|
-
</subelement>
|
15
|
-
</root>)
|
16
|
-
|
17
|
-
module GenericBase
|
18
|
-
class Base
|
19
|
-
include Comparable
|
20
|
-
include HappyMapper
|
21
|
-
|
22
|
-
def initialize(params = {})
|
23
|
-
@name = params[:name]
|
24
|
-
@href = params[:href]
|
25
|
-
@other = params[:other]
|
26
|
-
end
|
27
|
-
|
28
|
-
tag '*'
|
29
|
-
attribute :name, String
|
30
|
-
attribute :href, String
|
31
|
-
attribute :other, String
|
32
|
-
|
33
|
-
def <=>(other)
|
34
|
-
result = name <=> other.name
|
35
|
-
return result unless result == 0
|
36
|
-
|
37
|
-
result = href <=> other.href
|
38
|
-
return result unless result == 0
|
39
|
-
|
40
|
-
self.other <=> other.other
|
41
|
-
end
|
42
|
-
end
|
43
|
-
class Sub
|
44
|
-
include HappyMapper
|
45
|
-
tag 'subelement'
|
46
|
-
has_one :jello, Base, tag: 'jello'
|
47
|
-
end
|
48
|
-
class Root
|
49
|
-
include HappyMapper
|
50
|
-
tag 'root'
|
51
|
-
element :description, String
|
52
|
-
has_many :blargs, Base, tag: 'blarg', xpath: '.'
|
53
|
-
has_many :jellos, Base, tag: 'jello', xpath: '.'
|
54
|
-
has_many :subjellos, Base, tag: 'jello', xpath: 'subelement/.', read_only: true
|
55
|
-
has_one :sub_element, Sub
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe "can have generic classes using tag '*'" do
|
60
|
-
let(:root) { GenericBase::Root.parse(generic_class_xml) }
|
61
|
-
let(:xml) { Nokogiri::XML(root.to_xml) }
|
62
|
-
|
63
|
-
it 'maps different elements to same class' do
|
64
|
-
aggregate_failures do
|
65
|
-
expect(root.blargs).not_to be_nil
|
66
|
-
expect(root.jellos).not_to be_nil
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'filters on xpath appropriately' do
|
71
|
-
aggregate_failures do
|
72
|
-
expect(root.blargs.size).to eq(2)
|
73
|
-
expect(root.jellos.size).to eq(1)
|
74
|
-
expect(root.subjellos.size).to eq(1)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def base_with(name, href, other)
|
79
|
-
GenericBase::Base.new(name: name, href: href, other: other)
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'parses correct values onto generic class' do
|
83
|
-
aggregate_failures do
|
84
|
-
expect(root.blargs[0]).to eq base_with('blargname1', 'http://blarg.com', nil)
|
85
|
-
expect(root.blargs[1]).to eq base_with('blargname2', 'http://blarg.com', nil)
|
86
|
-
expect(root.jellos[0]).to eq base_with('jelloname', 'http://jello.com', nil)
|
87
|
-
expect(root.subjellos[0]).to eq base_with('subjelloname', 'http://ohnojello.com', 'othertext')
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
def validate_xpath(xpath, name, href, other)
|
92
|
-
expect(xml.xpath("#{xpath}/@name").text).to eq name
|
93
|
-
expect(xml.xpath("#{xpath}/@href").text).to eq href
|
94
|
-
expect(xml.xpath("#{xpath}/@other").text).to eq other
|
95
|
-
end
|
96
|
-
|
97
|
-
it '#to_xmls using parent element tag name' do
|
98
|
-
aggregate_failures do
|
99
|
-
expect(xml.xpath('/root/description').text).to eq('some description')
|
100
|
-
validate_xpath('/root/blarg[1]', 'blargname1', 'http://blarg.com', '')
|
101
|
-
validate_xpath('/root/blarg[2]', 'blargname2', 'http://blarg.com', '')
|
102
|
-
validate_xpath('/root/jello[1]', 'jelloname', 'http://jello.com', '')
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
it "properlies respect child HappyMapper tags if tag isn't provided on the element defintion" do
|
107
|
-
expect(xml.xpath('root/subelement').size).to eq(1)
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
data/spec/features/wrap_spec.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe 'wrap which allows you to specify a wrapper element', type: :feature do
|
6
|
-
module Wrap
|
7
|
-
class SubClass
|
8
|
-
include HappyMapper
|
9
|
-
tag 'subclass'
|
10
|
-
attribute :myattr, String
|
11
|
-
has_many :items, String, tag: 'item'
|
12
|
-
end
|
13
|
-
class Root
|
14
|
-
include HappyMapper
|
15
|
-
tag 'root'
|
16
|
-
attribute :attr1, String
|
17
|
-
element :name, String
|
18
|
-
wrap 'mywraptag' do
|
19
|
-
element :description, String
|
20
|
-
has_one :subclass, SubClass
|
21
|
-
end
|
22
|
-
element :number, Integer
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe '.parse' do
|
27
|
-
context 'when given valid XML' do
|
28
|
-
let(:root) { Wrap::Root.parse fixture_file('wrapper.xml') }
|
29
|
-
|
30
|
-
it 'sets the values correctly' do
|
31
|
-
aggregate_failures do
|
32
|
-
expect(root.attr1).to eq 'somevalue'
|
33
|
-
expect(root.name).to eq 'myname'
|
34
|
-
expect(root.description).to eq 'some description'
|
35
|
-
expect(root.subclass.myattr).to eq 'attrvalue'
|
36
|
-
expect(root.subclass.items.size).to eq(2)
|
37
|
-
expect(root.subclass.items[0]).to eq 'item1'
|
38
|
-
expect(root.subclass.items[1]).to eq 'item2'
|
39
|
-
expect(root.number).to eq 12_345
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'when initialized without XML' do
|
45
|
-
let(:root) { Wrap::Root.new }
|
46
|
-
|
47
|
-
it 'creates anonymous classes so nil class values do not occur' do
|
48
|
-
expect { root.description = 'anything' }.not_to raise_error
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe '.to_xml' do
|
54
|
-
let(:root) do
|
55
|
-
root = Wrap::Root.new
|
56
|
-
root.attr1 = 'somevalue'
|
57
|
-
root.name = 'myname'
|
58
|
-
root.description = 'some description'
|
59
|
-
root.number = 12_345
|
60
|
-
|
61
|
-
subclass = Wrap::SubClass.new
|
62
|
-
subclass.myattr = 'attrvalue'
|
63
|
-
subclass.items = []
|
64
|
-
subclass.items << 'item1'
|
65
|
-
subclass.items << 'item2'
|
66
|
-
|
67
|
-
root.subclass = subclass
|
68
|
-
|
69
|
-
root
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'generates the correct xml' do
|
73
|
-
xml = Nokogiri::XML(root.to_xml)
|
74
|
-
|
75
|
-
aggregate_failures do
|
76
|
-
expect(xml.xpath('/root/@attr1').text).to eq 'somevalue'
|
77
|
-
expect(xml.xpath('/root/name').text).to eq 'myname'
|
78
|
-
expect(xml.xpath('/root/mywraptag/description').text).to eq 'some description'
|
79
|
-
expect(xml.xpath('/root/mywraptag/subclass/@myattr').text).to eq 'attrvalue'
|
80
|
-
expect(xml.xpath('/root/mywraptag/subclass/item').size).to eq(2)
|
81
|
-
expect(xml.xpath('/root/mywraptag/subclass/item[1]').text).to eq 'item1'
|
82
|
-
expect(xml.xpath('/root/mywraptag/subclass/item[2]').text).to eq 'item2'
|
83
|
-
expect(xml.xpath('/root/number').text).to eq '12345'
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
data/spec/features/xpath_spec.rb
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
RSpec.describe 'Specifying elements and attributes with an xpath', type: :feature do
|
6
|
-
class Item
|
7
|
-
include HappyMapper
|
8
|
-
|
9
|
-
tag 'item'
|
10
|
-
namespace 'amazing'
|
11
|
-
|
12
|
-
element :title, String
|
13
|
-
attribute :link, String, xpath: 'amazing:link/@href'
|
14
|
-
has_one :different_link, String, xpath: 'different:link/@href'
|
15
|
-
element :detail, String, xpath: 'amazing:subitem/amazing:detail'
|
16
|
-
has_many :more_details_text, String, xpath: 'amazing:subitem/amazing:more'
|
17
|
-
has_many :more_details, String,
|
18
|
-
xpath: 'amazing:subitem/amazing:more/@first|amazing:subitem/amazing:more/@alternative'
|
19
|
-
has_many :more_details_alternative, String, xpath: 'amazing:subitem/amazing:more/@*'
|
20
|
-
|
21
|
-
has_one :baby, 'Baby', name: 'baby', namespace: 'amazing'
|
22
|
-
end
|
23
|
-
|
24
|
-
class Baby
|
25
|
-
include HappyMapper
|
26
|
-
|
27
|
-
has_one :name, String
|
28
|
-
end
|
29
|
-
|
30
|
-
let(:parsed_result) { Item.parse(xml_string, single: true) }
|
31
|
-
|
32
|
-
let(:xml_string) do
|
33
|
-
%(
|
34
|
-
<rss>
|
35
|
-
<amazing:item xmlns:amazing="http://www.amazing.com/amazing"
|
36
|
-
xmlns:different="http://www.different.com/different">
|
37
|
-
<amazing:title>Test XML</amazing:title>
|
38
|
-
<different:link href="different_link" />
|
39
|
-
<amazing:link href="link_to_resources" />
|
40
|
-
<amazing:subitem>
|
41
|
-
<amazing:detail>I want to parse this</amazing:detail>
|
42
|
-
<amazing:more first="this one">more 1</amazing:more>
|
43
|
-
<amazing:more alternative="another one">more 2</amazing:more>
|
44
|
-
</amazing:subitem>
|
45
|
-
<amazing:baby>
|
46
|
-
<amazing:name>Jumbo</amazing:name>
|
47
|
-
</amazing:baby>
|
48
|
-
</amazing:item>
|
49
|
-
</rss>
|
50
|
-
)
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'has a title' do
|
54
|
-
expect(parsed_result.title).to eq 'Test XML'
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'finds the link href value' do
|
58
|
-
expect(parsed_result.link).to eq 'link_to_resources'
|
59
|
-
end
|
60
|
-
|
61
|
-
it 'finds the other link href value' do
|
62
|
-
expect(parsed_result.different_link).to eq 'different_link'
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'finds this subitem based on the xpath' do
|
66
|
-
expect(parsed_result.detail).to eq 'I want to parse this'
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'finds the subitem texts based on the xpath' do
|
70
|
-
expect(parsed_result.more_details_text).to eq ['more 1', 'more 2']
|
71
|
-
end
|
72
|
-
|
73
|
-
it 'finds the subitem attributes based on the xpath' do
|
74
|
-
expect(parsed_result.more_details).to eq ['this one', 'another one']
|
75
|
-
end
|
76
|
-
|
77
|
-
it 'finds the subitem attributes based on the xpath with a wildcard' do
|
78
|
-
expect(parsed_result.more_details_alternative).to eq ['this one', 'another one']
|
79
|
-
end
|
80
|
-
|
81
|
-
it 'has a baby name' do
|
82
|
-
expect(parsed_result.baby.name).to eq 'Jumbo'
|
83
|
-
end
|
84
|
-
end
|
data/spec/fixtures/address.xml
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<ambigous>
|
3
|
-
<my-items>
|
4
|
-
<item>
|
5
|
-
<name>My first item</name>
|
6
|
-
<item><name>My first internal item</name></item>
|
7
|
-
</item>
|
8
|
-
<item>
|
9
|
-
<name>My second item</name>
|
10
|
-
<item><name>My second internal item</name></item>
|
11
|
-
</item>
|
12
|
-
<item>
|
13
|
-
<name>My third item</name>
|
14
|
-
<item><name>My third internal item</name></item>
|
15
|
-
</item>
|
16
|
-
</my-items>
|
17
|
-
<others-items>
|
18
|
-
<item>
|
19
|
-
<name>Other item</name>
|
20
|
-
</item>
|
21
|
-
</others-items>
|
22
|
-
</ambigous>
|
data/spec/fixtures/analytics.xml
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<feed xmlns="http://www.w3.org/2005/Atom"
|
3
|
-
xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"
|
4
|
-
xmlns:dxp="http://schemas.google.com/analytics/2009">
|
5
|
-
<id>http://www.google.com/analytics/feeds/accounts/nunemaker@gmail.com</id>
|
6
|
-
<updated>2009-04-22T23:21:23.000-07:00</updated>
|
7
|
-
<title type="text">Profile list for nunemaker@gmail.com</title>
|
8
|
-
<link rel="self" type="application/atom+xml"
|
9
|
-
href="http://www.google.com/analytics/feeds/accounts/default"/>
|
10
|
-
<author>
|
11
|
-
<name>Google Analytics</name>
|
12
|
-
</author>
|
13
|
-
<generator version="1.0">Google Analytics</generator>
|
14
|
-
<openSearch:totalResults>4</openSearch:totalResults>
|
15
|
-
<openSearch:startIndex>1</openSearch:startIndex>
|
16
|
-
<openSearch:itemsPerPage>4</openSearch:itemsPerPage>
|
17
|
-
<entry>
|
18
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:47912</id>
|
19
|
-
<updated>2008-11-24T12:11:32.000-08:00</updated>
|
20
|
-
<title type="text">addictedtonew.com</title>
|
21
|
-
<link rel="alternate" type="text/html" href="http://www.google.com/analytics"/>
|
22
|
-
<dxp:tableId>ga:47912</dxp:tableId>
|
23
|
-
<dxp:property name="ga:accountId" value="85301"/>
|
24
|
-
<dxp:property name="ga:accountName" value="addictedtonew.com"/>
|
25
|
-
<dxp:property name="ga:profileId" value="47912"/>
|
26
|
-
<dxp:property name="ga:webPropertyId" value="UA-85301-1"/>
|
27
|
-
</entry>
|
28
|
-
<entry>
|
29
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:1897579</id>
|
30
|
-
<updated>2008-11-24T12:11:32.000-08:00</updated>
|
31
|
-
<title type="text">railstips.org</title>
|
32
|
-
<link rel="alternate" type="text/html" href="http://www.google.com/analytics"/>
|
33
|
-
<dxp:tableId>ga:1897579</dxp:tableId>
|
34
|
-
<dxp:property name="ga:accountId" value="85301"/>
|
35
|
-
<dxp:property name="ga:accountName" value="addictedtonew.com"/>
|
36
|
-
<dxp:property name="ga:profileId" value="1897579"/>
|
37
|
-
<dxp:property name="ga:webPropertyId" value="UA-85301-7"/>
|
38
|
-
</entry>
|
39
|
-
<entry>
|
40
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:17132454</id>
|
41
|
-
<updated>2009-04-22T23:21:23.000-07:00</updated>
|
42
|
-
<title type="text">johnnunemaker.com</title>
|
43
|
-
<link rel="alternate" type="text/html" href="http://www.google.com/analytics"/>
|
44
|
-
<dxp:tableId>ga:17132454</dxp:tableId>
|
45
|
-
<dxp:property name="ga:accountId" value="85301"/>
|
46
|
-
<dxp:property name="ga:accountName" value="addictedtonew.com"/>
|
47
|
-
<dxp:property name="ga:profileId" value="17132454"/>
|
48
|
-
<dxp:property name="ga:webPropertyId" value="UA-85301-25"/>
|
49
|
-
</entry>
|
50
|
-
<entry>
|
51
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:17132478</id>
|
52
|
-
<updated>2009-04-22T23:21:23.000-07:00</updated>
|
53
|
-
<title type="text">harmonyapp.com</title>
|
54
|
-
<link rel="alternate" type="text/html" href="http://www.google.com/analytics"/>
|
55
|
-
<dxp:tableId>ga:17132478</dxp:tableId>
|
56
|
-
<dxp:property name="ga:accountId" value="85301"/>
|
57
|
-
<dxp:property name="ga:accountName" value="addictedtonew.com"/>
|
58
|
-
<dxp:property name="ga:profileId" value="17132478"/>
|
59
|
-
<dxp:property name="ga:webPropertyId" value="UA-85301-26"/>
|
60
|
-
</entry>
|
61
|
-
</feed>
|
@@ -1,127 +0,0 @@
|
|
1
|
-
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:dxp='http://schemas.google.com/analytics/2009' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/"CU4CSXo_cCp7I2A9Wx9RGU0."' gd:kind='analytics#accounts'>
|
2
|
-
<id>http://www.google.com/analytics/feeds/accounts/someuser@gmail.com</id>
|
3
|
-
<updated>2010-12-20T19:59:28.448-08:00</updated>
|
4
|
-
<title>Profile list for someuser@gmail.com</title>
|
5
|
-
<link rel='self' type='application/atom+xml' href='https://www.google.com/analytics/feeds/accounts/default'/>
|
6
|
-
<author>
|
7
|
-
<name>Google Analytics</name>
|
8
|
-
</author>
|
9
|
-
<generator version='1.0'>Google Analytics</generator>
|
10
|
-
<openSearch:totalResults>9</openSearch:totalResults>
|
11
|
-
<openSearch:startIndex>1</openSearch:startIndex>
|
12
|
-
<openSearch:itemsPerPage>9</openSearch:itemsPerPage>
|
13
|
-
<dxp:segment id='gaid::-1' name='All Visits'>
|
14
|
-
<dxp:definition> </dxp:definition>
|
15
|
-
</dxp:segment>
|
16
|
-
<dxp:segment id='gaid::-2' name='New Visitors'>
|
17
|
-
<dxp:definition>ga:visitorType==New Visitor</dxp:definition>
|
18
|
-
</dxp:segment>
|
19
|
-
<dxp:segment id='gaid::-3' name='Returning Visitors'>
|
20
|
-
<dxp:definition>ga:visitorType==Returning Visitor</dxp:definition>
|
21
|
-
</dxp:segment>
|
22
|
-
<dxp:segment id='gaid::-4' name='Paid Search Traffic'>
|
23
|
-
<dxp:definition>ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga:medium==cpv,ga:medium==ppc</dxp:definition>
|
24
|
-
</dxp:segment>
|
25
|
-
<dxp:segment id='gaid::-5' name='Non-paid Search Traffic'>
|
26
|
-
<dxp:definition>ga:medium==organic</dxp:definition>
|
27
|
-
</dxp:segment>
|
28
|
-
<dxp:segment id='gaid::-6' name='Search Traffic'>
|
29
|
-
<dxp:definition>ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga:medium==cpv,ga:medium==organic,ga:medium==ppc</dxp:definition>
|
30
|
-
</dxp:segment>
|
31
|
-
<dxp:segment id='gaid::-7' name='Direct Traffic'>
|
32
|
-
<dxp:definition>ga:medium==(none)</dxp:definition>
|
33
|
-
</dxp:segment>
|
34
|
-
<dxp:segment id='gaid::-8' name='Referral Traffic'>
|
35
|
-
<dxp:definition>ga:medium==referral</dxp:definition>
|
36
|
-
</dxp:segment>
|
37
|
-
<dxp:segment id='gaid::-9' name='Visits with Conversions'>
|
38
|
-
<dxp:definition>ga:goalCompletionsAll>0</dxp:definition>
|
39
|
-
</dxp:segment>
|
40
|
-
<dxp:segment id='gaid::-10' name='Visits with Transactions'>
|
41
|
-
<dxp:definition>ga:transactions>0</dxp:definition>
|
42
|
-
</dxp:segment>
|
43
|
-
<dxp:segment id='gaid::-11' name='Mobile Traffic'>
|
44
|
-
<dxp:definition>ga:isMobile==Yes</dxp:definition>
|
45
|
-
</dxp:segment>
|
46
|
-
<dxp:segment id='gaid::-12' name='Non-bounce Visits'>
|
47
|
-
<dxp:definition>ga:bounces==0</dxp:definition>
|
48
|
-
</dxp:segment>
|
49
|
-
<entry gd:etag='W/"CkENQXs9fip7I2A9Wx5SE0w."' gd:kind='analytics#account'>
|
50
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:123456</id>
|
51
|
-
<updated>2010-08-08T16:38:10.566-07:00</updated>
|
52
|
-
<title>www.homedepot.com</title>
|
53
|
-
<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
|
54
|
-
<dxp:property name='ga:accountId' value='254087'/>
|
55
|
-
<dxp:property name='ga:accountName' value='www.homechefdepot.com'/>
|
56
|
-
<dxp:property name='ga:profileId' value='123456'/>
|
57
|
-
<dxp:property name='ga:webPropertyId' value='UA-254087-1'/>
|
58
|
-
<dxp:property name='ga:currency' value='USD'/>
|
59
|
-
<dxp:property name='ga:timezone' value='America/Los_Angeles'/>
|
60
|
-
<dxp:tableId>ga:123456</dxp:tableId>
|
61
|
-
</entry>
|
62
|
-
<entry gd:etag='W/"C0YESXcyfyp7I2A9Wx9SFkU."' gd:kind='analytics#account'>
|
63
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:8575980</id>
|
64
|
-
<updated>2010-12-06T16:18:28.997-08:00</updated>
|
65
|
-
<title>www.pda.org</title>
|
66
|
-
<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
|
67
|
-
<dxp:property name='ga:accountId' value='4277553'/>
|
68
|
-
<dxp:property name='ga:accountName' value='www.pdma.org'/>
|
69
|
-
<dxp:property name='ga:profileId' value='8575980'/>
|
70
|
-
<dxp:property name='ga:webPropertyId' value='UA-4277553-1'/>
|
71
|
-
<dxp:property name='ga:currency' value='USD'/>
|
72
|
-
<dxp:property name='ga:timezone' value='America/Los_Angeles'/>
|
73
|
-
<dxp:tableId>ga:8575980</dxp:tableId>
|
74
|
-
</entry>
|
75
|
-
<entry gd:etag='W/"CU4CSXo_cCp7I2A9Wx9RGU0."' gd:kind='analytics#account'>
|
76
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:25620226</id>
|
77
|
-
<updated>2010-12-20T19:59:28.448-08:00</updated>
|
78
|
-
<title>business.com</title>
|
79
|
-
<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
|
80
|
-
<dxp:property name='ga:accountId' value='12312214'/>
|
81
|
-
<dxp:property name='ga:accountName' value='business.com'/>
|
82
|
-
<dxp:property name='ga:profileId' value='25620226'/>
|
83
|
-
<dxp:property name='ga:webPropertyId' value='UA-12312214-1'/>
|
84
|
-
<dxp:property name='ga:currency' value='USD'/>
|
85
|
-
<dxp:property name='ga:timezone' value='America/Los_Angeles'/>
|
86
|
-
<dxp:tableId>ga:25620226</dxp:tableId>
|
87
|
-
</entry>
|
88
|
-
<entry gd:etag='W/"CU4CSX0yfCp7I2A9Wx9RGU0."' gd:kind='analytics#account'>
|
89
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:12123131</id>
|
90
|
-
<updated>2010-12-20T19:59:28.394-08:00</updated>
|
91
|
-
<title>blog.com</title>
|
92
|
-
<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
|
93
|
-
<dxp:property name='ga:accountId' value='12312214'/>
|
94
|
-
<dxp:property name='ga:accountName' value='business.com'/>
|
95
|
-
<dxp:property name='ga:profileId' value='12123131'/>
|
96
|
-
<dxp:property name='ga:webPropertyId' value='UA-12345678-1'/>
|
97
|
-
<dxp:property name='ga:currency' value='USD'/>
|
98
|
-
<dxp:property name='ga:timezone' value='America/Los_Angeles'/>
|
99
|
-
<dxp:tableId>ga:12123131</dxp:tableId>
|
100
|
-
</entry>
|
101
|
-
<entry gd:etag='W/"DUMNQHk_fSp7I2A9Wx5bEE4."' gd:kind='analytics#account'>
|
102
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:37685582</id>
|
103
|
-
<updated>2010-10-25T13:11:31.745-07:00</updated>
|
104
|
-
<title>The Social</title>
|
105
|
-
<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
|
106
|
-
<dxp:property name='ga:accountId' value='12312214'/>
|
107
|
-
<dxp:property name='ga:accountName' value='business.com'/>
|
108
|
-
<dxp:property name='ga:profileId' value='37685582'/>
|
109
|
-
<dxp:property name='ga:webPropertyId' value='UA-12312214-1'/>
|
110
|
-
<dxp:property name='ga:currency' value='USD'/>
|
111
|
-
<dxp:property name='ga:timezone' value='America/Los_Angeles'/>
|
112
|
-
<dxp:tableId>ga:37685582</dxp:tableId>
|
113
|
-
</entry>
|
114
|
-
<entry gd:etag='W/"DE8HR3o4eCp7I2A9Wx5UF0w."' gd:kind='analytics#account'>
|
115
|
-
<id>http://www.google.com/analytics/feeds/accounts/ga:38132423</id>
|
116
|
-
<updated>2010-10-21T20:07:16.430-07:00</updated>
|
117
|
-
<title>Skyline</title>
|
118
|
-
<link rel='alternate' type='text/html' href='http://www.google.com/analytics'/>
|
119
|
-
<dxp:property name='ga:accountId' value='12312214'/>
|
120
|
-
<dxp:property name='ga:accountName' value='business.com'/>
|
121
|
-
<dxp:property name='ga:profileId' value='38132423'/>
|
122
|
-
<dxp:property name='ga:webPropertyId' value='UA-12312214-1'/>
|
123
|
-
<dxp:property name='ga:currency' value='USD'/>
|
124
|
-
<dxp:property name='ga:timezone' value='America/Los_Angeles'/>
|
125
|
-
<dxp:tableId>ga:38132423</dxp:tableId>
|
126
|
-
</entry>
|
127
|
-
</feed>
|
data/spec/fixtures/atom.xml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
|
3
|
-
<id>tag:www.example.com,2005:/tv_shows</id>
|
4
|
-
<link rel="alternate" type="text/html" href="http://www.example.com"/>
|
5
|
-
<link rel="self" type="application/atom+xml" href="http://www.example.com/tv_shows.atom"/>
|
6
|
-
<title>TV Shows</title>
|
7
|
-
<updated>2011-07-08T13:47:01Z</updated>
|
8
|
-
<entry>
|
9
|
-
<id>tag:www.example.com,2005:TvShow/17</id>
|
10
|
-
<published>2011-07-08T13:47:01Z</published>
|
11
|
-
<updated>2011-07-08T13:47:01Z</updated>
|
12
|
-
<link rel="alternate" type="text/html" href="http://www.example.com/sources/channel-twenty-seven/tv_shows/name-goes-here.atom"/>
|
13
|
-
<title>Name goes here</title>
|
14
|
-
<content type="html">Name goes here (0 episodes)</content>
|
15
|
-
<author>
|
16
|
-
<name>Source URL goes here</name>
|
17
|
-
</author>
|
18
|
-
</entry>
|
19
|
-
</feed>
|
data/spec/fixtures/commit.xml
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<commit>
|
3
|
-
<removed type="array">
|
4
|
-
<removed>
|
5
|
-
<filename>commands.rb</filename>
|
6
|
-
</removed>
|
7
|
-
<removed>
|
8
|
-
<filename>helpers.rb</filename>
|
9
|
-
</removed>
|
10
|
-
</removed>
|
11
|
-
<added type="array">
|
12
|
-
<added>
|
13
|
-
<filename>commands/commands.rb</filename>
|
14
|
-
</added>
|
15
|
-
<added>
|
16
|
-
<filename>commands/helpers.rb</filename>
|
17
|
-
</added>
|
18
|
-
</added>
|
19
|
-
<message>move commands.rb and helpers.rb into commands/ dir</message>
|
20
|
-
<modified type="array">
|
21
|
-
<modified>
|
22
|
-
<diff>@@ -56,7 +56,7 @@ module GitHub
|
23
|
-
end
|
24
|
-
|
25
|
-
def load(file)
|
26
|
-
- file[0] == ?/ ? super : super(BasePath + "/#{file}")
|
27
|
-
+ file[0] == ?/ ? super : super(BasePath + "/commands/#{file}")
|
28
|
-
end
|
29
|
-
|
30
|
-
def debug(*messages)</diff>
|
31
|
-
<filename>lib/github.rb</filename>
|
32
|
-
</modified>
|
33
|
-
</modified>
|
34
|
-
<parents type="array">
|
35
|
-
<parent>
|
36
|
-
<id>d462d2a2e60438ded3dd9e8e6593ca4146c5a0ba</id>
|
37
|
-
</parent>
|
38
|
-
</parents>
|
39
|
-
<url>http://github.com/defunkt/github-gem/commit/c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b</url>
|
40
|
-
<author>
|
41
|
-
<name>Chris Wanstrath</name>
|
42
|
-
<email>chris@ozmm.org</email>
|
43
|
-
</author>
|
44
|
-
<id>c26d4ce9807ecf57d3f9eefe19ae64e75bcaaa8b</id>
|
45
|
-
<committed-date>2008-03-02T16:45:41-08:00</committed-date>
|
46
|
-
<authored-date>2008-03-02T16:45:41-08:00</authored-date>
|
47
|
-
<tree>28a1a1ca3e663d35ba8bf07d3f1781af71359b76</tree>
|
48
|
-
<committer>
|
49
|
-
<name>Chris Wanstrath</name>
|
50
|
-
<email>chris@ozmm.org</email>
|
51
|
-
</committer>
|
52
|
-
</commit>
|