Skip to content
This repository
  • 1 commit
  • 3 files changed
  • 0 comments
  • 1 contributor
9  app/controllers/doit_controller.rb
@@ -46,7 +46,7 @@ def get_code
46 46
     child = fork do 
47 47
       @@def_token_obj = @@client.auth_code.get_token(get_code, { :redirect_uri => 'http://localhost:3000', 
48 48
                                                              :token_method => :post }) 
49  
-        while true do                                                     
  49
+        1.times do                                                     
50 50
           conan(format_stories, get_stats)
51 51
         end
52 52
     end
@@ -60,10 +60,7 @@ def  conan(projects, projects_stats)
60 60
       proj_stats = projects_stats[i]
61 61
         token_obj = @@def_token_obj
62 62
         token_obj = refresh_access_token_do_it(token_obj)
63  
-        puts "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
64 63
         token = token_obj.token
65  
-        puts token
66  
-        puts "_________________________________________________________________________________"
67 64
         @access_token_obj = OAuth2::AccessToken.new(@@client, token) 
68 65
         
69 66
         puts "sak rakstit projektu"
@@ -71,11 +68,11 @@ def  conan(projects, projects_stats)
71 68
         puts "#########################################################################"
72 69
         if exist(@access_token_obj, project_id)
73 70
             doit_write(@access_token_obj, project_id, proj, proj_stats) 
74  
-            puts "sarakstija"
  71
+            puts "sarakstija projktu #{project_id}"
75 72
         else
76 73
             project = Project.new(@access_token_obj, project_id)
77 74
             doit_write(@access_token_obj, project_id, proj, proj_stats)
78  
-            puts "sarakstija"
  75
+            puts "sarakstija projktu #{project_id}"
79 76
         end
80 77
         i +=1
81 78
       end
6  lib/google.rb
@@ -95,7 +95,7 @@ def create_worksheet(post_to_url,  worksheet_title, access_token_obj)
95 95
               doc2 = Nokogiri::Slop(response2.body)
96 96
               link = doc.link(:css => "[rel='http://schemas.google.com/spreadsheets/2006#cellsfeed']")["href"] 
97 97
               link2 = doc2.link(:css => "[rel='http://schemas.google.com/spreadsheets/2006#cellsfeed']")["href"] 
98  
-              cols = %w{id project_id story_type url estimate current_state description name requested_by created_at updated_at accepted_at labels tasks}
  98
+              cols = %w{id project_id story_type url estimate current_state description name requested_by created_at updated_at accepted_at releas_at labels activity tasks}
99 99
               stats_cols = ["date", "feature count", "feature points sum", "accepted feature count", "accepted feature points sum", "bug count", "accepted bug count", "chore count"]
100 100
               
101 101
               cell_feed_loop(link, cols, access_token_obj)
@@ -263,9 +263,7 @@ def write_data_doit(def_link, array_of_data)
263 263
                       col += 1   
264 264
                 end
265 265
                   row +=1   
266  
-                  if row == 4
267  
-                    break
268  
-                  end
  266
+                  
269 267
                 
270 268
               end
271 269
           end
30  lib/pivotal.rb
@@ -63,26 +63,42 @@ def format_stories()
63 63
                   doc = Nokogiri::XML(story.to_s)
64 64
                   index = 0
65 65
                   story = []
66  
-                  status = 0
  66
+                  labels = 0
  67
+                  activity = 0
  68
+                  deadline = 0
67 69
                   doc.xpath("//story").children.each do |line| 
68 70
                       index +=1  
69 71
                       if index % 2 == 0 
  72
+                        story << line.content
70 73
                         if line.node_name == "labels"
71  
-                          status = 1
  74
+                          labels = 1
  75
+                        end 
  76
+                        if line.node_name == "deadline"
  77
+                          deadline = 1
  78
+                        end
  79
+                        if line.node_name == "notes"
  80
+                          activity = 1
72 81
                         end
73  
-                        story << line.content 
74  
-                        
75 82
                       end
  83
+                     
  84
+                      
76 85
                   end
77 86
                   unless story[2] == "feature"
78 87
                     story.insert(4, "")
79 88
                   end
80  
-                  unless story[5] == 'accepted'
  89
+                  unless story[5] == 'accepted' 
81 90
                     story.insert(11, "")
82 91
                   end
83  
-                  if status == 0
84  
-                     story.insert(12, "")
  92
+                  if  deadline == 0 
  93
+                    story.insert(12, "release_at")
  94
+                  end
  95
+                  if labels == 0
  96
+                    story.insert(13, "la")
  97
+                  end
  98
+                  if activity == 0
  99
+                    story.insert(14, "acti")
85 100
                   end
  101
+                  
86 102
                   stories << story
87 103
                   story = []
88 104
               end

No commit comments for this range

Something went wrong with that request. Please try again.