opsask 2.1.1 → 2.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b304f6deb490fcfdc272f734d1b672a7a67208f0
4
- data.tar.gz: 4d9b2ebca8385397321c1a49a7ff870d05318461
3
+ metadata.gz: 79cbbbc8e1d3fa740db85a47e8994fc3104d3a0f
4
+ data.tar.gz: 58ee161e52d07bf32674a6ccdbf54c3d5346956b
5
5
  SHA512:
6
- metadata.gz: f698f8b6ca4f8b362ea8d453daf42c6a006ffb1bd72b90bced8eb3373dcd8c560c56e5037a2da0d59859cb7de4f78b72b3d717ccb5e21fdac513dbf514a4fafe
7
- data.tar.gz: 61ace41d5e9f6526df69f3ae51db11eeae3863989f880d769c7fa4ad8bfc5140a973c0af41864dd6bd2991f73d737bd9a78debb3d9256d29baf1933518e40185
6
+ metadata.gz: 5816e5221cedc00217939d90b5b8dd09e334c2857b20532514b585f2607d196575a21645bc04399e4066ab4c844373e95689e97a3e5ca4bcf0ae3b957ee1288a
7
+ data.tar.gz: 253338f6357419efde0cc65e873e9bcd7e87d1ff666f81c8a05e65a5479fb13fac3e816840d122b298e4b0c042c37043ee50e5e1cda982afa3dc08bc8be3af70
data/Readme.md CHANGED
@@ -50,7 +50,9 @@ Configuration is JSON:
50
50
  "jira_private_key": "/path/to/consumer.pem", // You probably generated it
51
51
  "jira_consumer_key": "consumer-key", // Name associated with key
52
52
  "require_label": "GoodLabel", // Scope to label (optional)
53
- "ignore_label": "BadLabel" // Filter out label (optional)
53
+ "ignore_label": "BadLabel", // Filter out label (optional)
54
+ "agile_board": 181, // RapidViewID for Sprint stats
55
+ "sprint_prefix": "Sprint" // Sprint name prefix (optional)
54
56
  }
55
57
 
56
58
  To fill out `jira_private_key` and `jira_consumer_key`, you'll need to create
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.1.2
data/lib/opsask/app.rb CHANGED
@@ -65,9 +65,9 @@ module OpsAsk
65
65
  sprint: sprint,
66
66
  ask_stats: stats_for(
67
67
  asks_in_sprint(num),
68
- "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (Sprint#{num}) and resolution is not empty", nil)}",
69
- "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (Sprint#{num}) and resolution is empty", nil)}",
70
- "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (Sprint#{num}) and \"Story Points\" is empty", nil)}"
68
+ "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (#{sprint_label_prefix}#{num}) and resolution is not empty", nil)}",
69
+ "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (#{sprint_label_prefix}#{num}) and resolution is empty", nil)}",
70
+ "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (#{sprint_label_prefix}#{num}) and \"Story Points\" is empty", nil)}"
71
71
  ),
72
72
  sprint_stats: stats_for(
73
73
  items_in_sprint(num),
@@ -87,9 +87,9 @@ module OpsAsk
87
87
  sprint: current_sprint,
88
88
  ask_stats: stats_for(
89
89
  asks_in_current_sprint,
90
- "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (Sprint#{num}) and resolution is not empty", nil)}",
91
- "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (Sprint#{num}) and resolution is empty", nil)}",
92
- "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (Sprint#{num}) and \"Story Points\" is empty", nil)}"
90
+ "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (#{sprint_label_prefix}#{num}) and resolution is not empty", nil)}",
91
+ "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (#{sprint_label_prefix}#{num}) and resolution is empty", nil)}",
92
+ "#{settings.config[:jira_url]}/issues/?jql=#{URI::escape normalized_jql("labels in (#{sprint_label_prefix}#{num}) and \"Story Points\" is empty", nil)}"
93
93
  ),
94
94
  sprint_stats: stats_for(
95
95
  items_in_current_sprint,
@@ -95,7 +95,7 @@ module OpsAsk
95
95
  def asks_in_sprint num
96
96
  return [] unless logged_in?
97
97
  issues = []
98
- query = normalized_jql("labels in (Sprint#{num})", nil)
98
+ query = normalized_jql("labels in (#{sprint_label_prefix}#{num})", nil)
99
99
  @jira_client.Issue.jql(query, max_results: 500).each do |i|
100
100
  issues << i.attrs
101
101
  end
@@ -123,8 +123,16 @@ module OpsAsk
123
123
  return nil
124
124
  end
125
125
 
126
+ def sprint_prefix
127
+ settings.config[:sprint_prefix] ||= 'Sprint'
128
+ end
129
+
130
+ def sprint_label_prefix
131
+ sprint_prefix.gsub(/\s+/, '')
132
+ end
133
+
126
134
  def get_sprint num
127
- sprint = sprints.select { |s| s['name'] == "Sprint #{num}" }
135
+ sprint = sprints.select { |s| s['name'] == "#{sprint_prefix} #{num}" }
128
136
  sprint_id = sprint.first['id']
129
137
  url = "#{settings.config[:jira_url]}/rest/greenhopper/1.0/rapid/charts/sprintreport?rapidViewId=#{settings.config[:agile_board]}&sprintId=#{sprint_id}"
130
138
  curl_request = Curl::Easy.http_get(url) do |curl|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsask
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Clemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-11 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor